| Keyword 'Capture Page Screenshot' could not be run on failure: error: [Errno 111] Connection refused |
| 14:09:29.637 | INFO | /usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:787: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) Traceback (most recent call last): File "./resources/baseUI.py", line 73, in _open_login_page self.driver.go_to(self._getenvurl()) File "<decorator-gen-36>", line 2, in go_to File "/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/keywordgroup.py", line 15, in _run_on_failure_decorator return method(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/_browsermanagement.py", line 410, in go_to self._current_browser().get(url) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 213, in get self.execute(Command.GET, {'url': url}) File "/usr/local/lib/python2.7/dist-packages/Selenium2Library/webdrivermonkeypatches.py", line 11, in execute result = self._base_execute(driver_command, params) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 199, in execute response = self.command_executor.execute(driver_command, params) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 395, in execute return self._request(command_info[0], url, body=data) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 425, in _request self._conn.request(method, parsed_url.path, body, headers) File "/usr/lib/python2.7/httplib.py", line 1052, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.7/httplib.py", line 1092, in _send_request self.endheaders(body) File "/usr/lib/python2.7/httplib.py", line 1048, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 892, in _send_output self.send(msg) File "/usr/lib/python2.7/httplib.py", line 854, in send self.connect() File "/usr/lib/python2.7/httplib.py", line 831, in connect self.timeout, self.source_address) File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err error: [Errno 111] Connection refused |
Ugh
Unfortunately browsers and the underlying technology is not bullet proof. Also I see similar errors perhaps once and twice a month (when I run 10-12 hours of test in a day). But if your ratio is bigger, then there might be something else wrong in your set up.
I see from the stack trace that the error happens when the browser is trying to navigate to the URL. But that doesn't, unfortunately, help us much. To help you better could you please tell, when you encounter the problem, is it always exactly the same error? Does it always happen with the same keyword? What browser and version you are using and have you tried with different browser and/or version? What version of Selenium2Library, selenium and Python you are using? Also if you are using other browser than Firefox, could you tell the driver version too.
-Tatu
Send from my mobile
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Ugh
The code looks OK. Did you try with another browser, like Chrome, to rule out that this is a Firefox specific problem? Also have you tried with different selenium versions? Also, is there a display, virtual or real one, where the browser runs?
-Tatu
Send from my mobile
Ugh
Perhaps looking selenium architecture[1] explains the problem better. The selenium Python client uses the json wire protocol to talk to driver. The driver could be a separate executable, like the chrome driver or like in Firefox (version 47 or older) a extension. The selenium Python client talks to the driver by using http and the error you see, is caused by a failure in that http interface. It's not caused by the browser not reaching the destination url. Why the failure happens is a good question and I don't have answer for it. The most elegant solution I have found, is to try with different browser, selenium and driver version and stick with the combination that works. And also allow updates to happen only in a controlled manner.
-Tatu
Send from my mobile
[1] http://seleniumtutorialpoint.com/2015/01/webdriver-architecture/