Repository navigation
Error with capture screenshot #56
Description
My tests fail during teardown with following errors, it seems screenshot capture fails.
13:27:59.164 TRACE Arguments: [ ]
13:27:59.174 DEBUG GET http://127.0.0.1:1363/hub/session/70000fba-176c-48cb-8f60-4adbfe323390/screenshot {"sessionId": "70000fba-176c-48cb-8f60-4adbfe323390"}
13:28:00.165 FAIL URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>
13:28:00.165 DEBUG Traceback (most recent call last): File "", line 2, in capture_page_screenshot File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.7.egg\Selenium2Library\keywords\keywordgroup.py", line 12, in _run_on_failure_decorator return method(_args, *_kwargs) File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.7.egg\Selenium2Library\keywords_screenshot.py", line 27, in capture_page_screenshot self._current_browser().save_screenshot(path) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 81, in save_screenshot png = RemoteWebDriver.execute(self, Command.SCREENSHOT)['value'] File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.7.egg\Selenium2Library\webdrivermonkeypatches.py", line 11, in execute result = self._base_execute(driver_command, params) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 151, in execute response = self.command_executor.execute(driver_command, params) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 283, in execute return self._request(url, method=command_info[0], data=data) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 324, in _request response = opener.open(request) File "C:\Python27\lib\urllib2.py", line 391, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 409, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 369, in _call_chain result = func(_args) File "C:\Python27\lib\urllib2.py", line 1173, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python27\lib\urllib2.py", line 1148, in do_open raise URLError(err)
13:28:00.175 TRACE Return: None
13:27:58.223 TRACE Arguments: [ ]
13:27:58.223 DEBUG Closing browser with session id 70000fba-176c-48cb-8f60-4adbfe323390
13:27:58.223 DEBUG DELETE http://127.0.0.1:1363/hub/session/70000fba-176c-48cb-8f60-4adbfe323390 {"sessionId": "70000fba-176c-48cb-8f60-4adbfe323390"}
13:28:00.175 WARN Keyword 'Capture Page Screenshot' could not be run on failure: URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>
13:28:00.185 FAIL URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>
13:28:00.185 DEBUG Traceback (most recent call last): File "", line 2, in close_browser File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.7.egg\Selenium2Library\keywords\keywordgroup.py", line 12, in _run_on_failure_decorator return method(_args, *_kwargs) File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.7.egg\Selenium2Library\keywords_browsermanagement.py", line 50, in close_browser self._cache.close() File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.7.egg\Selenium2Library\utils\browsercache.py", line 23, in close browser.quit() File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 61, in quit RemoteWebDriver.quit(self) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 443, in quit self.execute(Command.QUIT) File "C:\Python27\lib\site-packages\robotframework_selenium2library-1.0.0-py2.7.egg\Selenium2Library\webdrivermonkeypatches.py", line 11, in execute result = self._base_execute(driver_command, params) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 151, in execute response = self.command_executor.execute(driver_command, params) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 283, in execute return self._request(url, method=command_info[0], data=data) File "C:\Python27\lib\site-packages\selenium-2.21.3-py2.7.egg\selenium\webdriver\remote\remote_connection.py", line 324, in _request response = opener.open(request) File "C:\Python27\lib\urllib2.py", line 391, in open response = self._open(req, data) File "C:\Python27\lib\urllib2.py", line 409, in _open '_open', req) File "C:\Python27\lib\urllib2.py", line 369, in _call_chain result = func(_args) File "C:\Python27\lib\urllib2.py", line 1173, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Python27\lib\urllib2.py", line 1148, in do_open raise URLError(err)
13:28:00.195 TRACE Return: None
Activity
j1z0 commentedon May 22, 2012
This important part of the error is :
URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>
This is usually because webdriver has already been shut down, or potentially you have some sort of firewall blocking access. The firewall doesn't really make sense if this error only occurs in teardown. So I would guess it's a timing issue. Is it possible that the browser or webdriver server has already been shut down? Can you send a sample script that reproduces the issue perhaps?
j1z0 commentedon May 23, 2012
Cool. I like an easy fix. :)
Cheers,
Jeremy
On May 22, 2012, at 18:37, vrpatilreply@reply.github.com wrote:
Gurud commentedon Oct 29, 2012
*** Settings ***
Library Selenium2Library
**** Test case ****
GoogleTest
[Documentation] Verification from Google Search page
[Tags] BIE
Selenium2Library.Open Browser https://www.google.co.in/ ie
Maximize Browser Window
Selenium2Library.Title Should Be Google
Selenium2Library.Input Text q Dealertrack canada
Selenium2Library.Click Button btnG
After run its Fail with below message -
[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: TypeErro
r: must be string or buffer, not None
Google Page :: Verification from Google Search page | FAIL |
Title should have been 'Google' but was ''
Please provide inputs to solve it soon.
Cheers, Gaurav
emanlove commentedon Dec 11, 2012
@Gurud If you are still experiencing an issue please reopen another issue or, even better, post a question to the robotframework-users mailing list, http://groups.google.com/group/robotframework-users.