Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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. –  Aaron Jan 6 '12 at 19:40
    
Sorry, just noticed this. Yes, the selenium user forum is hosted on google groups: groups.google.com/group/selenium-users –  Sam Woods Jan 13 '12 at 0:30

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.