← Quiz: Web Elements: all 10 questions
Quiz: Web Elements · Question 3 of 10
After working inside an iframe, how do you return to the main page?
After working inside an iframe, how do you return to the main page?
- A.driver.switchTo().defaultContent()
- B.driver.navigate().back()
- C.driver.close()
- D.driver.switchTo().alert()
Answer & explanation
Correct answer: driver.switchTo().defaultContent()
parentFrame() goes up one level; defaultContent() returns to the top.
Can you get the rest right without peeking?
Take the timed Quiz: Web Elements quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →