Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium: Run test on my machine remotely?

So I am running Chromedriver on my computer (win, administrator mode) like

chromedriver.exe --verbose --whitelisted-ips=

On my server I have tests that I want to run on my own computer.

So I set up the Remote Webdriver, and the tests seems to start up without problems but I don't see any Chrome window spawned by Chromedriver on my computer, nor do I see any log messages. The test on my server eventually times out and displays:

 File "/server/tests/test.py", line 173, in test
    browser = Browser(driver_name="remote",url="http://23.23.23.23:9515/wd/hub", browser='chrome',user_agent='test', desired_capabilities=options.to_capabilities())
  File "/usr/local/lib/python2.7/dist-packages/splinter/browser.py", line 63, in Browser
    return driver(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/splinter/driver/webdriver/remote.py", line 26, in __init__
    self.driver = Remote(url, abilities)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 73, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 121, in start_session
    'desiredCapabilities': desired_capabilities,
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 171, 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 349, 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 417, in _request
    resp = opener.open(request)
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 110] Connection timed out>
like image 207
user299709 Avatar asked Jun 29 '15 18:06

user299709


1 Answers

solution: use selenium grid, it works that way as well.

like image 84
user299709 Avatar answered Sep 20 '22 16:09

user299709