selenium switch focus to frame with no name or ID

  • 1 Replies
  • 1145 Views
*

Ali

  • *
  • 8
selenium switch focus to frame with no name or ID
« on: July 03, 2016, 19:11:00 pm »
When the iframe has a name all i do is:

Code
driver.SwitchTo().Frame(iframe);

How can i switch to a frame that has no identifier ?

*

Oren

  • **
  • 59
Re: selenium switch focus to frame with no name or ID
« Reply #1 on: July 06, 2016, 11:33:25 am »
driver.switchTo().frame() accepts an integer that will return a frame from a list of frames available.

so just try to switch to the first available (depending on how many frames you have in your page):

Code
driver.switchTo().frame(0);

 

Sitemap 1 2 3 4 5 6 7 8