Selenium: Run test on my machine remotely?
Asked Answered
C

1

6

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>
Centime answered 29/6, 2015 at 18:54 Comment(3)
Find out what TCP port selenium is using on your workstation then try to telnet to it from the server to verify connectivity. I betcha it is network/firewall related issue.Phosphorylase
@browskie I'll give that a shot, but I allowed chromedriver to bypass the firewall....let me double checkCentime
@browskie just tried it, but I can't even ping it. I get unknown host. I made sure that it accepts all connections from public and so onCentime
C
2

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

Centime answered 2/7, 2015 at 20:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.