selenium 3.0 seems to be a bug
Update the definition of the quit() method in webdriver.py of firefox as follows (relative path: ..\Python27\Lib\site-packages\selenium\webdriver\firefox\webdriver.py ):
change the following line in the quit() method:
shutil.rmtree(self.profile.path) #which gives Nonetype has no attribute path if self.profile.tempfolder is not None: shutil.rmtree(self.profile.tempfolder)
to
if self.profile is not None: shutil.rmtree(self.profile.path) # if self.profile is not None, then only rmtree method is called for path. if self.profile.tempfolder is not None: shutil.rmtree(self.profile.tempfolder) # if tempfolder is not None, then only rmtree is called for tempfolder.
Note : wherever self.profile used, do the same. those. move the code to the state indicated above.
In selenium 3.0 , profile and binary moved to firefox_options instead of their separate existence as firefox_profile and firefox_binary respectively in Selenium 2.0 .
you can check this in webdriver.py (of firefox ) in the __init__ method.
the corresponding code in the __init__ method:
if firefox_options is None: firefox_options = Options() print dir(firefox_options)
Note. It has been observed that firefox_options.profile still sets to None , which may be a problem to fix in selenium 3.0
source share