0

I am using the following python script to open and start Firefox browser. It works at times while in other cases,it is giving an error.What am i doing wrong here?

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()

The error i am getting is this which is not happening always.

 Traceback (most recent call last):
File "seleniumtest.py", line 4, in <module>
driver = webdriver.Firefox()
File "C:\Python27\lib\site-packages\selenium-2.53.1-py2.7.egg\selenium\webdrier\firefox\webdriver.py", line 103, in __init__
self.binary, timeout)
File "C:\Python27\lib\site-packages\selenium-2.53.1-py2.7.egg\selenium\webdrier\firefox\extension_connection.py", line 49, in __init__
self.profile.add_extension()
File "C:\Python27\lib\site-packages\selenium-2.53.1-py2.7.egg\selenium\webdrier\firefox\firefox_profile.py", line 91, in add_extension
self._install_extension(extension)
File "C:\Python27\lib\site-packages\selenium-2.53.1-py2.7.egg\selenium\webdrier\firefox\firefox_profile.py", line 287, in _install_extension
shutil.rmtree(tmpdir)
File "C:\Python27\lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "C:\Python27\lib\shutil.py", line 256, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "C:\Python27\lib\shutil.py", line 254, in rmtree
os.rmdir(path)

WindowsError: [Error 145] The directory is not empty: 'c:\\users\\cgdc\\appata\\local\\temp\\tmpqirkg6.webdriver.xpi\\components'

1 Answer 1

1

Check whether your file is having only read-only flag.

refer :-

python shutil.rmtree throwing errors

Hope it will help you :)

Sign up to request clarification or add additional context in comments.

1 Comment

can u please provide more clarity on what is to be done so that i can try and accept the answer if correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.