Skip to content
CodeKruPro

close() versus quit()

QuizEasyAsked in: Accenture, TCS, Wipro

Two browser windows are open in one Selenium session. What does quit() do that close() does not?

  • It closes every window and ends the session, so the driver process stops too
  • It closes only the window that has focus
  • It clears cookies but keeps the browser open
  • Nothing: the two methods are the same

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in