Selenium + Java · Lesson 15 of 44
Module 15: Selenium Setup
Your task
Implement safeQuitDriver:
Write it in the editor, then press Check answer (Ctrl + Enter).
pom.xml)<dependency>
<groupId>org.openqa.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.26.0</version>
</dependency>quit() vs close()driver.close(): Closes the currently active browser window. If other tabs remain open, the driver session stays active.driver.quit(): Terminates the entire WebDriver session, kills the browser process, and frees OS memory. Always use in @AfterEach!In this lesson, we configure the Maven pom.xml with selenium-java, launch Chrome, Firefox, and Edge, and understand the critical difference between driver.close() and driver.quit(). Let's dive in!
Part of the Selenium + Java course (Selenium with Java). Practice this concept live in the Selenium Online Compiler or explore our free automation practice form.
Orphaned chromedriver.exe and browser processes remain in memory, quickly consuming all RAM on local machines and CI agents.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___