Uninformative IEDriverServer crash

288 views
Skip to first unread message

Андрей Веселов

unread,
Aug 21, 2017, 11:15:53 AM8/21/17
to Selenium Users
I using  Win7, IE11, Python 3.5, Selenium 3.5.0, IEDriverServer 3.5.0(dowloaded from seleniumhq.org download page) and faced with problem with webdriver.implicitly_wait() method:

from selenium import webdriver
driver
= webdriver.Ie('IEDriverServer.exe')
driver
.implicitly_wait(10)
driver
.close()


Code above causing crash with error:

Traceback (most recent call last):
  File "C:/Users/myuser/Documents/workspace/py_proj/qa/test.py", line 28, in <module>
    driver.implicitly_wait(10)
  File "C:\Users\myuser\Documents\Python3.5\lib\site-packages\selenium-3.5.0-py3.5.egg\selenium\webdriver\remote\webdriver.py", line 767, in implicitly_wait
    'implicit': int(float(time_to_wait) * 1000)})
  File "C:\Users\myuser\Documents\Python3.5\lib\site-packages\selenium-3.5.0-py3.5.egg\selenium\webdriver\remote\webdriver.py", line 295, in execute
    response = self.command_executor.execute(driver_command, params)
  File "C:\Users\myuser\Documents\Python3.5\lib\site-packages\selenium-3.5.0-py3.5.egg\selenium\webdriver\remote\remote_connection.py", line 464, in execute
    return self._request(command_info[0], url, body=data)
  File "C:\Users\myuser\Documents\Python3.5\lib\site-packages\selenium-3.5.0-py3.5.egg\selenium\webdriver\remote\remote_connection.py", line 526, in _request
    resp = opener.open(request, timeout=self._timeout)
  File "C:\Users\myuser\Documents\Python3.5\lib\urllib\request.py", line 466, in open
    response = self._open(req, data)
  File "C:\Users\myuser\Documents\Python3.5\lib\urllib\request.py", line 484, in _open
    '_open', req)
  File "C:\Users\myuser\Documents\Python3.5\lib\urllib\request.py", line 444, in _call_chain
    result = func(*args)
  File "C:\Users\myuser\Documents\Python3.5\lib\urllib\request.py", line 1282, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "C:\Users\myuser\Documents\Python3.5\lib\urllib\request.py", line 1257, in do_open
    r = h.getresponse()
  File "C:\Users\myuser\Documents\Python3.5\lib\http\client.py", line 1198, in getresponse
    response.begin()
  File "C:\Users\myuser\Documents\Python3.5\lib\http\client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "C:\Users\myuser\Documents\Python3.5\lib\http\client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Users\myuser\Documents\Python3.5\lib\socket.py", line 576, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

Log file of IEDriverServer (TRACE level) ends on:

T 2017-08-21 17:43:56:887 server.cc(183) Process request with: URI: /session/58f37907-d593-45df-a8ff-7e77e10f260d/timeouts HTTP verb: POST
body: {"implicit": 10000, "sessionId": "58f37907-d593-45df-a8ff-7e77e10f260d"}
T 2017-08-21 17:43:56:887 server.cc(272) Entering Server::DispatchCommand
T 2017-08-21 17:43:56:887 server.cc(583) Entering Server::LookupCommand
D 2017-08-21 17:43:56:887 server.cc(281) Command: POST /session/58f37907-d593-45df-a8ff-7e77e10f260d/timeouts {"implicit": 10000, "sessionId": "58f37907-d593-45df-a8ff-7e77e10f260d"}
T 2017-08-21 17:43:56:887 server.cc(378) Entering Server::LookupSession
T 2017-08-21 17:43:56:887 IESession.cpp(191) Entering IESession::ExecuteCommand
T 2017-08-21 17:43:56:887 IECommandExecutor.cpp(122) Entering IECommandExecutor::OnSetCommand
T 2017-08-21 17:43:56:887 command.cc(31) Entering Command::Deserialize
D 2017-08-21 17:43:56:887 command.cc(36) Raw JSON command: { "name" : "setTimeouts", "locator" : { "sessionid" : "58f37907-d593-45df-a8ff-7e77e10f260d" }, "parameters" : {"implicit": 10000, "sessionId": "58f37907-d593-45df-a8ff-7e77e10f260d"} }
T 2017-08-21 17:43:56:887 IECommandExecutor.cpp(133) Entering IECommandExecutor::OnExecCommand
T 2017-08-21 17:43:56:887 IESession.cpp(212) Beginning wait for response length to be not zero
T 2017-08-21 17:43:56:887 IECommandExecutor.cpp(454) Entering IECommandExecutor::DispatchCommand
T 2017-08-21 17:43:56:887 IECommandExecutor.cpp(567) Entering IECommandExecutor::GetCurrentBrowser
T 2017-08-21 17:43:56:887 IECommandExecutor.cpp(573) Entering IECommandExecutor::GetManagedBrowser
T 2017-08-21 17:43:56:887 IECommandExecutor.cpp(523) Entering IECommandExecutor::IsAlertActive
T 2017-08-21 17:43:56:887 Browser.cpp(713) Entering Browser::GetActiveDialogWindowHandle
T 2017-08-21 17:43:56:887 Browser.cpp(206) Entering Browser::GetContentWindowHandle
D 2017-08-21 17:43:56:888 IECommandExecutor.cpp(537) No alert handle is found


I'm not found any simmilar issues at selenium bugtracker. While trying to find the cause of crash I found that setTimeouts requests to IEDriverServer contains this data:
'{"implicit": 10000, "sessionID": "some_session_id_as_string"}'

Also in selenium/cpp/iedriver/CommandHandlers/SetTimeoutsCommandHandler.cpp line 39 asInt() method from jsoncpp lib used and it looks like for "sessionId" value this method should raise error in
selenium/third_party/cpp/json-cpp/src/jsoncpp.cpp line 2141 (JSON_FAIL_MESSAGE which #define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message);)

This code works correct(problem relate only with implicitly_wait / script_wait / page_load_wait):
from selenium import webdriver
driver
= webdriver.Ie('IEDriverServer.exe')
driver
.get('http://any_host.com')
driver
.close()

I suppose that real problem may be not in IEDriver, but in some environment things(otherway many people should have faced it). If enyone have any thoghts about where I can find root of issue described above?

Stan Pattenden

unread,
Sep 21, 2017, 12:07:25 AM9/21/17
to Selenium Users
Hi, I get exactly the same error with my python code, that is the same construct as that shown above.  The implicitly_wait causes the error.. IEDriverServer v3.4 is fine as was v3.1. But 3.5.0 and 3.5.1 give me this error.
I note the distributed executable is much smaller with the two latest 3.5.x versions than it was with those leading up to it. This may be correct or may indicate an issue with the distro.

As a workaround I've gone back to v3.4.  Can't yet find anything about this on any other forum.

Joseph Olstad

unread,
Jan 18, 2018, 12:52:37 PM1/18/18
to Selenium Users
Thanks so much, I've been searching for a solution for a few days now, but not python, I am using php (behat) ,  downgrading to IEDriverServer 3.4.0 works.  I confirm that same problem exists in 3.8.0, I had to downgrade to the IEDriverServer.exe 3.4.0 (in my case 32 bit version for windows 7) , and using selenium standalone 3.4.0

Here is a link to my setup, I am using behat / php.
https://stackoverflow.com/questions/20973130/how-to-run-behat-with-internet-explorer

Jaidev Nair

unread,
Mar 6, 2018, 9:41:51 PM3/6/18
to Selenium Users
Even I faced the same issue. I was using the 64 bit IEDriverServer. After going through various forums and not getting correct resolution, I just replaced the IEDriverServer with the 32 bit driver.
And it worked. I do not know the reason but this is a workaround.
Reply all
Reply to author
Forward
0 new messages