4

Anyone know how to fix intermittent 'Access is denied' errors when trying to .quit() Chrome in Selenium WebDriver tests? It's happening about 1 in 10 times.

Here's the traceback:

Traceback (most recent call last):
 File "C:\blah.py", line 30, in blah_test
 self.browser.quit()
 File "C:\Python27\lib\site-packages\selenium-2.15.0-py2.7.egg\selenium\webdriver\chrome\webdriver.
py", line 62, in quit
 self.service.stop()
 File "C:\Python27\lib\site-packages\selenium-2.15.0-py2.7.egg\selenium\webdriver\chrome\service.py
", line 94, in stop
 os.kill(self.process.pid, signal.SIGTERM)
WindowsError: [Error 5] Access is denied

The code is (I've simplified it here):

from selenium import webdriver
self.browser = webdriver.Chrome()
self.browser.quit()

I'm on Windows 7 using latest ChromeDriver.exe (version 17 I think it is) and latest Selenium (2.15) and Python 2.7.x.

dzieciou
10.5k9 gold badges49 silver badges102 bronze badges
asked Jan 5, 2012 at 0:41

2 Answers 2

1

I haven't run into that, but if it is a bug in Selenium, the easiest workaround would be to surround it in a try/catch and retry a few times. I would follow up by asking (or searching for existing answers) whether it is a known issue on the Selenium users forum.

dzieciou
10.5k9 gold badges49 silver badges102 bronze badges
answered Jan 5, 2012 at 18:02
2
  • Sam, is there an 'official' forum for Selenium you could link me to? Or at least whichever one is the most highly-trafficed / likely to get responses? Thanks. Commented Jan 6, 2012 at 19:40
  • Sorry, just noticed this. Yes, the selenium user forum is hosted on google groups: groups.google.com/group/selenium-users Commented Jan 13, 2012 at 0:30
0

I think this issue is not related with Selenium itself, but with python on Windows 7 (since it falls on os.kill method). How to fix it I don't have idea but there are some similar issues found while using words: access denied process python windows 7 on searching engine.

dzieciou
10.5k9 gold badges49 silver badges102 bronze badges
answered Jan 6, 2012 at 20:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.