Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

I wanted to use  WatiN Web Application Testing In .Net, to test  html page with multi-level frames:

E.g TopFrame.aspx :
<Frameset>
     <FRAME SRC="ContentFrame.aspx">
</Frameset>

ContentFrame.aspx
<body>
     <IFRAME SRC="SubFrame.aspx">
</body>

When I tried to check ie.Frame("ContentFrame") it didn't show me html of ContentFrame.aspx(as expected), but showed html of parent  TopFrame.aspx. I've attached debug version of WatiN and stepped through to opening page. And in debugger  ie.Frame("ContentFrame")  was populated correctly.

I thought that the problem is with timeout of loading down-level page(SubFrame.aspx in my sample). Unfortunately 
increase of TimeOut didn't help.
I've done a few attempts in debugger and sometimes(when I had breakpoints in IE.CreateNewIEAndGoToUri and DomContainer.WaitWhileMainDocumentNotAvailable) it loaded html of content frame, but mostly showed parent's frameset.
There are some ideas to try in discussions: best way to find if webbrowser is totally ready and Webbrowser Wait!.

I've reported the problem to WatiN bug list 1747471 "Frame is not loaded for page with multi-level frames".

Posted on Friday, June 29, 2007 1:39 PM ASP.NET , Testing/Debugging/Logging | Back to top


Comments on this post: WatiN testing of multi-level Frames page

# re: WatiN testing of multi-level Frames page
Requesting Gravatar...
Jeroen,
Thank you very much for your advice.
I've downloaded the latest version of IE.cs from http://watin.svn.sourceforge.net/viewvc/*checkout*/watin/trunk/src/Core/IE.cs?revision=446
and with createInNewProcess=true it works fine.
Left by Michael Freidgeim on Aug 14, 2007 11:55 PM

# re: WatiN testing of multi-level Frames page
Requesting Gravatar...
I would be curious to see how InCIsif.net would react to the problem.
<IFRAME> are sometime problematic.
Left by FTorres on Sep 08, 2007 3:34 AM

# re: WatiN testing of multi-level Frames page
Requesting Gravatar...
I dont know if it's the same. I tried to get a button that was in an inner IFrame and Watin didnt find it. What i did was that looked for the IFrame Element and then got the DOM from it. And problem solved.
Left by diegoeche on Apr 07, 2008 8:34 AM

# re: WatiN testing of multi-level Frames page
Requesting Gravatar...
Hi diegoeche, could you post an example of the code you used?
Left by Wally on May 06, 2008 1:14 PM

# re: WatiN testing of multi-level Frames page
Requesting Gravatar...
Wally,
Below is the example of using normal Frame.
IFrame , I hope, will be similar.
Frame mainFrame = ie.Frame("mainframe");
Button btnLogoff = mainFrame.Button(Find.ByName("ContentView$PageLayout$BottomNav$btnLogoff"));
Left by Michael Freidgeim on May 07, 2008 5:48 PM

# re: WatiN testing of multi-level Frames page
Requesting Gravatar...
Frame frame1 = browser.Frame(Find.ByName("frame1Name"));
Frame frame2 = frame1.Frame(Find.ByClass("XXXX"));
frame2.TextField(Find.ById("textboxid")).Value = "some value";
Left by kavitha on Nov 08, 2010 5:22 AM

# re: WatiN testing of multi-level Frames page
Requesting Gravatar...
Frame frame1 = browser.Frame(Find.ByName("frame1Name"));
Frame frame2 = frame1.Frame(Find.ByClass("XXXX"));
frame2.TextField(Find.ById("textboxid")).Value = "some value";

Hi, i had error at:
Frame frame2 = frame1.Frame(Find.ByClass("XXXX"));

i using WatiN ver 2.1
Left by Nguyen Trong Tu on Oct 22, 2012 12:42 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net