Selenium:运行 在我的机器上远程测试?
Selenium: Run test on my machine remotely?
所以我运行宁Chrome我电脑上的驱动程序(win,管理员模式)喜欢
chromedriver.exe --verbose --whitelisted-ips=
在我的服务器上,我想在自己的计算机上运行进行测试。
所以我设置了 Remote Webdriver,测试开始时似乎没有问题,但我没有在我的计算机上看到 Chrome window 由 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>
解决方法:使用selenium grid,这样也行。
所以我运行宁Chrome我电脑上的驱动程序(win,管理员模式)喜欢
chromedriver.exe --verbose --whitelisted-ips=
在我的服务器上,我想在自己的计算机上运行进行测试。
所以我设置了 Remote Webdriver,测试开始时似乎没有问题,但我没有在我的计算机上看到 Chrome window 由 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>
解决方法:使用selenium grid,这样也行。