What is the difference between driver close and driver quit

0 votes

I am learning python selenium and when I refer to codes, some codes use driver.quit() and some code use driver.close(). What is the difference between the both these? When I run them, both closes the browser.

Apr 6, 2019 in Python by Raj
28,605 views

1 answer to this question.

0 votes
They do a similar thing but not exactly the same. driver.quit() is used to exit the browser, end the session, tabs, pop-ups etc.

But the when you driver.close(), only the window that has focus is closed. It is better to use driver.close() when you are dealing with multiple tabs or windows.
answered Apr 6, 2019 by Yash
0 votes
close- This method is used to close the current browser.

Quit- This method is used to close all the browsers,tabs.
answered Aug 20, 2021 by anonymous

edited Mar 5

Related Questions In Python

0 votes
1 answer

What is the difference between list and tuple?

List has [ ] brackets while tuple ...READ MORE

answered May 11, 2021 in Python by Mohit Khurana

edited Mar 5 7,237 views
+1 vote
2 answers

What is the difference between classes and labels in machine learning?

Classes and Labels both are almost same things ...READ MORE

answered Apr 3, 2019 in Python by SA
• 1,090 points
8,062 views
0 votes
1 answer

What is the difference between Python and IPython?

There are few differences between Python and ...READ MORE

answered Jul 26, 2018 in Python by Priyaj
• 58,020 points
4,213 views
0 votes
1 answer

What is the difference between re.search and re.match?

The theoritical approach can be this way, re.match is ...READ MORE

answered Aug 10, 2018 in Python by Priyaj
• 58,020 points
12,217 views
+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 58,020 points
2,609 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
14,231 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,472 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,524 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
8,068 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP