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

Quiz: Selenium Setup · Question 2 of 10

What is the difference between driver.close() and driver.quit()?

What is the difference between driver.close() and driver.quit()?

  1. A.close() closes the current window; quit() closes all windows and ends the driver session
  2. B.They are identical
  3. C.quit() only closes the current tab
  4. D.close() deletes the browser profile
Answer & explanation

Correct answer: close() closes the current window; quit() closes all windows and ends the driver session

Always call quit() at the end of a test.

Can you get the rest right without peeking?

Take the timed Quiz: Selenium Setup quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →