selenium issue related to frame and iframe navigation recursively

61 views
Skip to first unread message

Ashwini kamble

unread,
Oct 20, 2015, 3:09:58 AM10/20/15
to Selenium Users
<frameset framespacing="0" border="0" noresize="" frameborder="0" rows="93,73%">
 
   <frame name="top" scrolling="no" noresize="" target="middle" src="mainhead.as">
   </frame >
   <frame name="middle" target="bottom" scrolling="yes" src="welcome.as">
   
         <iframe name="middleFrame" src="department.as" style="width:100%; height:450;" frameborder="0">
                       <iframe src="departmentlistframe.as" width="100%" height="360" frameborder="4" id="listFrame" name="listFrame" marginheight="0" scrolling="AUTO">
</iframe>
         </iframe>
 </frame >
</frameset>


Details :- 

There are two frames "top" and " middle". "middle" frame contains iframe "middleFrame" and "middleFrame" contains iframe "listFrame".
I want to switch to "top" frame and get all linkstext here and click on first link and switch to frame " middle". here click first link 
and switch to iframe "middleFrame" get all links here and switch to "listFrame" and get all linkstext and navigate back to frame "middle"
and click second link and so on...

Work Details:- 

till now i have succesfully switched to clicked on first link of "top" Frame and then navigate to "middle" frame get all links here.
then switched to "middleFrame" get all links and switched to "listFrame" and get all linktext.

Problem Area:- 

after getting all links from "listFrame" i am not able to switched to frame "middle" and click on second link to move further.
AS i am new selenium user, so m not yet switched to POM and TESTng Framework.


Realated Code :- please do let me know if required..!!



"Thanks in advance..!!!!"






Travis

unread,
Oct 21, 2015, 10:36:04 AM10/21/15
to Selenium Users
You may just have to switch back to the page's default content:

driver.switchTo().defaultContent();
driver
.switchTo().frame("middleFrame");

Once you're in the listFrame, you will get an error if you try to switch to a frame that isn't in its scope.  Since the "middle" frame contains the listFrame, and not the other way around, "middle" isn't in listFrame's scope.

Ashwini kamble

unread,
Oct 22, 2015, 1:12:01 AM10/22/15
to seleniu...@googlegroups.com
Thanku u so much for ur reply...but i didn't get u..!!1
There is little change in problem i am abli to switch to "middleFrame" from "listFrame" but the problem is it is redirecting me back to the First link and not to the second link.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c2daba65-ec14-48e2-9125-7ce76d076b01%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages