Last post May 14, 2009 08:56 PM by farmas
May 04, 2009 03:21 PM|FRMJiggs|LINK
Can anyone help me with the way to find any child element of the iFrame control?
All I can get is the Iframe control itself but its child elements count is 0.
iFrame control is being navigated dynamically, i.e. based on user action on the page.
May 05, 2009 01:34 AM|qwe123kids|LINK
Or check the Link below
Hope it helps
May 05, 2009 09:32 AM|FRMJiggs|LINK
Thanks for the reply...
May 05, 2009 12:33 PM|farmas|LINK
Frame support is comming in the next release of LTAF. All the pieces are in the April release already but the public API to expose it is missing, you can look this post
http://forums.asp.net/t/1412750.aspx for a discussion of how to enable it for the current release.
This is an example of how a test will look like that automates an iFrame (part of our sample app that will also be released):
public void PageWithIFrame()
HtmlPage page = new HtmlPage("TestFrameSet.htm");
// get bottom frame
HtmlPage bottomFrame = page.GetFramePage("bottomFrame");
// verify title of frame
Assert.AreEqual("This is the bottom frame with an iFrame", bottomFrame.Elements.Find("h1", 0).GetInnerText());
// get the iFrame
HtmlPage iFrame = bottomFrame.GetFramePage("theIFrame");
//click on a button in frame
Assert.AreEqual("Button has been clicked", iFrame.Elements.Find("TheSpan").GetInnerText());
May 14, 2009 08:42 PM|FRMJiggs|LINK
I was able to get the frame elements by the way you suggested in earlier post. However I tried to make it more generic as mentioned in following code:
Some public properties in HtmlPage.cs...
And my test case looks like this:
Now waiting for next release so we can run test cases more efficiently in single new window. Or can you provide any private code now which will behave like feature itself?
May 14, 2009 08:56 PM|farmas|LINK
Hey Jignesh, I am glad that it worked out for you. The next release already includes improved frame support, code looks like this:
HtmlPage framePage = originalPage.GetFramePage("TheNameOfTheFrame");
Unfortunately, it is unlikely that I'll get to implement the auto run all tests on a popup window for the next release (coming first week of June). It is on our list of work items, but there are several other features ahead of it that are taking more time
(plus the QA team has been very busy testing .NET 4.0).
I can definetly send you a private build once I have it.