How To Resolve OSError : WinError 6 The Handle is Invalid

Share and Enjoy !

This is a very interesting failure. When we do prototype, say with 10 testcases,
Webdriver seems to have behave correctly. All testcases passes. Now when we
put out test suite,after execution of 10-12 testcases,It starts failing/Skipping or
erroring out. The trace we get is listed below:

Traceback (most recent call last):
File"C:UsersavraciuworkspaceAutomationTesting_v2.0srcHomeIPSEC", line 21, in
setUpself.driver = webdriver.Firefox()
File "",
line 64,in __init__self.binary, timeout),
File "C:Python34libsite-packagesseleniumwebdriverfirefox",
 line 51, in __init__self.binary.launch_browser(self.profile)
File "C:Python34libsite-packagesseleniumwebdriverfirefox", line 69,
 in launch_browser
File "",
line 92,
 in _start_from_profile_path  env=self._firefox_env)
File "", line 754, in __init___cleanup()
File "", line 474, in _cleanup
res = inst._internal_poll(_deadstate=sys.maxsize)
File "", line 1146, in _internal_poll
if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
OSError: [WinError 6] The handle is invalid

The Workaround:

Checkout the configuration may be that is wrong.Mostly the latest browser version and WebDriver version do not match. Downgrade one level down for browser. It should work. On the next step downgrade the Webdriver version as well.
Next is to check the version of the OS as well as the version of the installed software’s. Like-the eclipse,phython,webDriver etc. They should be as per OS. I mean if your’s is a 64 bit OS. Please use same 64 bit application as well. 

Share and Enjoy !

Leave a Reply

Your email address will not be published. Required fields are marked *