How do I switch between nested frames in Selenium?
Selenium helps to reach out elements inside frames by focus with in frame. So to navigate between two frames.,
- switch to first frame using any one of this . driver.switchTo().frame( frameNumber) switchTo().frame( frameName) switchTo().frame( WebElement)
perform required action with in that frame. Now navigate back to original parent window using
switchTo()defaultContent() or switchTo().parentFrame()
Now from parent window you can switch to another frame. If its nested frame , you no need to navigate back to default window, from parent window ,you can switch to another frame.