WebDriver’s driver.switchTo().frame() method takes one of the three possible arguments:
-
A number.
Select a frame by its (zero-based) index. That is, if a page has three
frames, the first frame would be at index0, the second at index1
and the third at index2. Once the frame has been selected, all
subsequent calls on the WebDriver interface are made to that frame. -
A name or ID.
Select a frame by its name or ID. Frames located by matching name
attributes are always given precedence over those matched by ID. -
A previously found
WebElement.Select a frame using its previously located WebElement.
Get the frame by it’s id/name or locate it by driver.findElement() and you’ll be good.