🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Web Elements: all 10 questions

Quiz: Web Elements · Question 8 of 10

A link opens an invoice in a new tab. How do you work in that tab?

A link opens an invoice in a new tab. How do you work in that tab?

  1. A.Selenium switches automatically
  2. B.Get the window handles and call driver.switchTo().window(handle) for the new one
  3. C.Use switchTo().frame()
  4. D.Open a new WebDriver
Answer & explanation

Correct answer: Get the window handles and call driver.switchTo().window(handle) for the new one

Save the main handle first so you can switch back afterwards.

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 →