Hey there! any question in your mind? Ask It Now!.

Popular Categories

How to handle iframe having not any Identifier in Selenium Webdriver?

0 votes
asked in Software Testing by nitin (810 points)

Hello guys I am stuck on this trying to switch a frame some how frame does not any Identifier like id or class, This is the HTML code here : 

<section class="box">
        <h3>See this</h3>
        <iframe src="http://xyz.com/id=6" scrolling="no" frameborder="0" height="340" width="100%"></iframe>
I have already handled iframe in webdriver by giving the name of iframe like this 
But in this case I am stuck.Please help me out in the same thanks! 


1 Answer

+3 votes
answered by Himanshu Expert (5,940 points)
selected by nitin
Best answer
Hello Nitin,
I got your problem even i have faced the same problem some how I found its solution, You need to just do this see :
This means if you have n number of iframes you can handle them by 0,1,2,3 etc. in case when iframe does not have any
I hope you got my point. 
commented by nitin (810 points)
Thanks @Himanshu it helped me,when i put (0) in the place of iframe ID i switched successfully into the frame.
Keep sharing your knowledge...
commented by tester (1,550 points)
I was faced same problem thanks @Himanshu for the solution.

Related Questions

+1 vote
1 answer 698 views
+1 vote
1 answer 4,622 views

Not a Member yet?

Ask to Folks Login

My Account
320 Folks are online
2 members and 318 guest online
Your feedback is highly appreciated