Recall & Review
beginner
What does the
close() method do in Selenium WebDriver?The
close() method closes the current browser window that the WebDriver is controlling. If multiple windows are open, only the active one is closed.Click to reveal answer
beginner
What is the difference between
close() and quit() methods in Selenium?close() closes only the current browser window, while quit() closes all browser windows and ends the WebDriver session completely.Click to reveal answer
intermediate
When should you use
quit() instead of close()?Use
quit() when you want to end the entire browser session and release all resources. This is useful at the end of a test to clean up properly.Click to reveal answer
intermediate
What happens if you call
close() on the last open browser window?If
close() is called on the last open window, it closes that window but the WebDriver session may still remain active until quit() is called.Click to reveal answer
beginner
Why is it important to call
quit() at the end of Selenium tests?Calling
quit() ensures all browser windows are closed and the WebDriver session is properly terminated, preventing resource leaks and hanging processes.Click to reveal answer
Which Selenium method closes all browser windows and ends the WebDriver session?
✗ Incorrect
quit() closes all browser windows and ends the WebDriver session completely.What does
close() do if multiple browser windows are open?✗ Incorrect
close() closes only the current active browser window.If you forget to call
quit() after tests, what might happen?✗ Incorrect
Not calling
quit() can leave browser windows open and cause resource leaks.Which method should you use to close only the current browser tab?
✗ Incorrect
close() closes only the current browser window or tab.After calling
close() on the last window, what is the WebDriver session state?✗ Incorrect
The WebDriver session remains active until
quit() is called, even if all windows are closed.Explain the difference between
close() and quit() in Selenium WebDriver.Think about how many windows each method closes and what happens to the WebDriver session.
You got /4 concepts.
Why is it important to call
quit() at the end of your Selenium tests?Consider what happens if you leave browser windows open after tests finish.
You got /4 concepts.