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 5 in Python by Raj
11 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 5 by Yash

Related Questions In Python

0 votes
1 answer

What is the difference between list and tuple?

Lists are mutable(values can be changed) whereas ...READ MORE

answered May 4, 2018 in Python by aayushi
• 750 points
988 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 in Python by SA
• 1,030 points
69 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
• 56,120 points
114 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
• 56,120 points
107 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
• 56,120 points
68 views
0 votes
1 answer

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,030 points
60 views
0 votes
1 answer
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,130 points
431 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
49 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.