2015-06-29 85 views
6

所以我在我的電腦(WIN,管理員模式)像Selenium:遠程運行我的機器上的測試?

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

我的服務器上運行Chromedriver我有,我想我自己的電腦上運行測試。

因此,我設置了遠程Web驅動程序,並且測試似乎沒有問題地啓動,但我沒有看到計算機上由Chromedriver產生的Chrome窗口,也沒有看到任何日誌消息。我的服務器上的測試最終超時並顯示:

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> 
+0

找出您的工作站上正在使用的TCP端口硒,然後嘗試從服務器telnet到它以驗證連接。我敢打賭,這是網絡/防火牆相關的問題。 – browskie

+0

@browskie我會給你一個鏡頭,但我允許chromedriver繞過防火牆....讓我仔細檢查 – user299709

+0

@browskie剛剛嘗試過,但我甚至不能ping它。我得到未知的主機。我確信它接受來自公衆的所有連接等等 – user299709

回答

2

解決方案:使用硒網格,它也可以這樣工作。

相關問題