Chrome driver sometimes not closed properly
Hi All,
I have a test suite of over 300 tests. When I run all tests at one go, 30% of tests fail because Chrome driver sometimes doesn't gets closed at the end of test which makes the subsequent tests to fail.
The test errors out at the beginning with error trace below. The following errors occurs because the driver object was not launched and it can't find the object reference of WebDriver.
Error trace given below ExceptionHandler function threw exception System.NullReferenceException: Object reference not set to an instance of an object.
The same test suite runs well on FF and Safari on Mac.
Is there any issue filed for this with Selenium HQ?
Or Is there any workaround /solution to this?
Thanks in advance.
it sounds like you are not ensuring that WebDriver closes.
I see that you are using C#, but in Java, for example.. one way to assure that your tests close, is wrapping it in a try finally.
try {
driver = new ChromeDriver...
assertTrue(...)
} finally {
driver.quit()
}
however, I am closing this as it is not a concrete issue with Selenium. If you find a concrete bug with Selenium, feel free to file it here. otherwise, for help requests, submit issues in the selenium-users group.
Hello David, What I noticed several times recently is, when the browser freezes due to some application issue, and error/exception occurs and we call teardown method which calls the driver.quit() method, but at this moment the chromedriver is not getting closed. I can see several chrome.exe and chromedriver.exe processes running in the process explorer.
This indicates me that there's something wrong with the chromedriver process which is denying to quit when chrome browser process is still running.
Is that enough concrete reason for you to take a look?
If the issue is that the chromedriver process or the browser itself is hanging, that sounds like a browser issue, or an issue that should be raised directly with the ChromeDriver team.
That sounds perfect. I was looking for the place to report issue. I got this link https://code.google.com/p/chromedriver/issues/list Not sure if this list is being worked or not as most of the projects are being moved to gitHub. Can I report the issue there? or suggest me the appropriate link. Thanks Jim :)
@svaze that's the correct link to report chromedriver issues.