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 closes.Click to reveal answer
beginner
What is the difference between
close() and quit() in Selenium?close() closes the current window, while quit() closes all browser windows and ends the WebDriver session.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 free all resources, especially after your test finishes.Click to reveal answer
intermediate
What happens if you call
close() on the last open browser window?Calling
close() on the last window closes the browser window, but the WebDriver session may still be running 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 close and the WebDriver session ends, preventing resource leaks and hanging processes.Click to reveal answer
What does
driver.close() do in Selenium?✗ Incorrect
close() closes only the current window controlled by the WebDriver.Which method should you use to end the WebDriver session and close all browser windows?
✗ Incorrect
quit() closes all windows and ends the WebDriver session.If multiple browser tabs are open, what happens when you call
close()?✗ Incorrect
close() closes only the active tab or window.What is a risk of not calling
quit() after tests?✗ Incorrect
Not calling
quit() can leave browser processes running, wasting memory and CPU.After calling
close() on the last window, what should you do to fully end the session?✗ Incorrect
You should call
quit() to end the WebDriver session and clean up.Explain the difference between
close() and quit() in Selenium WebDriver.Think about how many windows each method affects and session management.
You got /4 concepts.
Why is it important to call
quit() at the end of your Selenium tests?Consider what happens if browser processes stay open after tests.
You got /4 concepts.