I am writing an test automation library in C# using mshtml. All was going well in testing the web application until I can to a page containing an IFrame element. I do not know how to access the Document associated with the frame. I can get the IHTMLFrameElement easily enough,but I don't know how to change context to the frame's document. I've multiple approaches such using contentWindow.document property but I'm told theat the interface is not supported. Any point me in the right direction? I'm stumped...thx. - Jimmo
Jimmo wrote: > I am writing an test automation library in C# using mshtml. All was > going well in testing the web application until I can to a page > containing an IFrame element. I do not know how to access the > Document associated with the frame. I can get the IHTMLFrameElement > easily enough,but I don't know how to change context to the frame's > document. frames(frame-name-or-index).document; "frames" collection contains "window" objects of each frame. If you insist on going through IHTMLFrameElement, query it for IHTMLFrameBase2 and use contentWindow property. > I've multiple approaches such using contentWindow.document > property but I'm told theat the interface is not supported. Should be supported as of IE5.5 -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
I'm sure it is supported. I think the problem lies in the Microsoft.mshtml.dll interop library shipped with Visual Studio 2003. the contentWindow or contextDocument properties throw "Interface not suppored" message. The frames property returns a FrameCollection which also fails....Driving me nuts. I don't want to hack into the interop library...