Selenium WebDriver Quick Start Guide (2024)

Two very important methods available in the WebDriver interface are quit() and close(). For beginners in Selenium, this is a topic of confusion because of a lack of understanding of its usage. Let's next understand both these methods, using these distinctions:

  • driver.quit(): The quit() method quits the driver, closing every associated window.
  • driver.close(): The close() method closes the currently focused window, quitting the driver if the current window is the only open window. If there are no windows open, it will error out.

We will be looking in detail at these two methods when we learn about handling popups.

Selenium WebDriver Quick Start Guide (2024)
Top Articles
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 6350

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.