70. How to switch
between frames?
WebDriver's driver.switchTo().frame() method
takes one of the three possible arguments:
Select a frame by its (zero-based) index. That
is, if a page has three frames, the first frame would be at index
"0", the second at index "1" and the third at index
"2". Once the frame has been selected, all subsequent calls on the
WebDriver interface are made to that frame.
Select a frame by its name or ID. Frames located
by matching name attributes are always given precedence over those matched by
ID.
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.
hi ,
ReplyDeletesay suppose, u have 40 frames in a page. and how do i fetch the index of a particular frame
i need some more clearly.please can u elaborate
ReplyDelete