Python 在Ubuntu中运行selenium案例时出现URLOpen错误

Python 在Ubuntu中运行selenium案例时出现URLOpen错误,python,ubuntu,selenium,Python,Ubuntu,Selenium,我在Ubuntu中安装了selenium,并为Python编写了自己的框架。 每当我使用框架运行任何测试用例时,我都会遇到以下错误。 但是,我可以在不使用框架的情况下成功运行相同的selenium案例 我尝试过的东西,但力不起作用: 重新安装selenium,但它没有帮助。 重新启动VM(我可以以任何方式连接到网络) 有人能就这个错误给我一些建议吗 ERROR: setUpClass (__main__.AuraAccountCreation) ----------------------

我在Ubuntu中安装了selenium,并为Python编写了自己的框架。 每当我使用框架运行任何测试用例时,我都会遇到以下错误。 但是,我可以在不使用框架的情况下成功运行相同的selenium案例

我尝试过的东西,但力不起作用: 重新安装selenium,但它没有帮助。 重新启动VM(我可以以任何方式连接到网络)

有人能就这个错误给我一些建议吗

   ERROR: setUpClass (__main__.AuraAccountCreation)
----------------------------------------------------------------------
Traceback (most recent call last):
File "../../../tiselenium/core/testcase.py", line 100, in setUpClass
self.driver = browser_mapping[driver](**args)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.37.2-py2.7.egg/selenium    /webdriver/remote/webdriver.py", line 71, in __init__
self.start_session(desired_capabilities, browser_profile)
 File "/usr/local/lib/python2.7/dist-packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 113, in start_session
'desiredCapabilities': desired_capabilities,
 File "/usr/local/lib/python2.7/dist-packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 162, in execute
 response = self.command_executor.execute(driver_command, params)
 File "/usr/local/lib/python2.7/dist-packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/remote_connection.py", line 355, in execute
return self._request(url, method=command_info[0], data=data)
 File "/usr/local/lib/python2.7/dist-packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/remote_connection.py", line 402, in _request
response = 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 111] Connection refused>
错误:setUpClass(\uuuuu main\uuuuuu.AuraAccountCreation)
----------------------------------------------------------------------
回溯(最近一次呼叫最后一次):
文件“./../../tiselenium/core/testcase.py”,第100行,在setUpClass中
self.driver=浏览器_映射[driver](**参数)
文件“/usr/local/lib/python2.7/dist-packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/webdriver.py”,第71行,在__
self.start\u会话(所需的\u功能、浏览器\u配置文件)
文件“/usr/local/lib/python2.7/dist packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/webdriver.py”,第113行,在启动会话中
“desiredCapabilities”:所需的功能,
文件“/usr/local/lib/python2.7/dist packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/webdriver.py”,执行中第162行
响应=self.command\u executor.execute(driver\u command,params)
文件“/usr/local/lib/python2.7/dist packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/remote_connection.py”,执行中第355行
返回self.\u请求(url,方法=命令\u信息[0],数据=数据)
文件“/usr/local/lib/python2.7/dist packages/selenium-2.37.2-py2.7.egg/selenium/webdriver/remote/remote\u connection.py”,第402行,在请求中
响应=opener.open(请求)
文件“/usr/lib/python2.7/urllib2.py”,第400行,打开
响应=自身打开(请求,数据)
文件“/usr/lib/python2.7/urllib2.py”,第418行,打开
"开放",
文件“/usr/lib/python2.7/urllib2.py”,第378行,在调用链中
结果=func(*args)
文件“/usr/lib/python2.7/urllib2.py”,第1207行,在http\u open中
返回self.do_open(httplib.HTTPConnection,req)
文件“/usr/lib/python2.7/urllib2.py”,第1177行,打开
引发URL错误(err)
URL错误:

您描述的症状强烈表明您的框架正在使用不正确的数据调用selenium。