Webdriver Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

带的小弟遇到这个问题不知所措就找我解决,记录一下。

执行如下代码,chrome和IE都OK,执行火狐就挂了。

#浏览器数组
lists = ['chrome','internet explorer','firefox']
#循环浏览器执行脚本      
for browser in lists:
    print browser
    driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub',
                    desired_capabilities={'platform':'ANY',
                                            'browserName':browser,
                                            'version':'',
                                            'javascriptEnabled':True
                                            })
    driver.implicitly_wait(30)
    driver.get('http://www.baidu.com')
   
    driver.find_element_by_id("kw").clear()
    driver.find_element_by_id("kw").send_keys("unittest")
    driver.find_element_by_id("su").click()
    time.sleep(1)
    title = driver.title
    print title

 

<!--StartFragment -->
firefox
Traceback (most recent call last):
  File "D:\workspace-tradeadmin\pydevTest\src\date06\seleniumGrid\test2.py", line 19, in <module>
    'javascriptEnabled':True
  File "F:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 74, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "F:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 123, in start_session
    'desiredCapabilities': desired_capabilities,
  File "F:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 175, in execute
    self.error_handler.check_response(response)
  File "F:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 166, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
nymous2012254099297209597webdriver-profile\\extensions\\easyscreenshot@mozillaonline.com.xpi","e":true,"v":"1.2.5","st":1435203687047},"fxdriver@googlecode.com":{"d":"C:\\Users\\dyyt\\AppData\\Local\\Temp\\anonymous2012254099297209597webdriver-profile\\extensions\\fxdriver@googlecode.com","e":false,"v":"2.42.2","st":1435203685165,"mt":1435203685138},"tabtweak@mozillaonline.com":{"d":"C:\\Users\\dyyt\\AppData\\Local\\Temp\\anonymous2012254099297209597webdriver-profile\\extensions\\tabtweak@mozillaonline.com.xpi","e":true,"v":"3.0.37","st":1435203687053},"wx-assistant@mozillaonline.com":{"d":"C:\\Users\\dyyt\\AppData\\Local\\Temp\\anonymous2012254099297209597webdriver-profile\\extensions\\wx-assistant@mozillaonline.com.xpi","e":true,"v":"1.1.3","st":1435203687059}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"37.0.2","st":1435200785629,"mt":1429136985000}}}

1435203692905 addons.xpi DEBUG No changes found

1435203692908 addons.xpi DEBUG Registering manifest for C:\Users\dyyt\AppData\Local\Temp\anonymous2012254099297209597webdriver-profile\extensions\commonfix@mozillaonline.com.xpi

1435203692908 addons.xpi DEBUG Loading bootstrap scope from C:\Users\dyyt\AppData\Local\Temp\anonymous2012254099297209597webdriver-profile\extensions\commonfix@mozillaonline.com.xpi

1435203692911 addons.xpi DEBUG Calling bootstrap method startup on commonfix@mozillaonline.com version 0.10

1435203692937 addons.xpi DEBUG Registering manifest for C:\Users\dyyt\AppData\Local\Temp\anonymous2012254099297209597webdriver-profile\extensions\wx-assistant@mozillaonline.com.xpi

1435203692938 addons.xpi DEBUG Loading bootstrap scope from C:\Users\dyyt\AppData\Local\Temp\anonymous2012254099297209597webdriver-profile\extensions\wx-assistant@mozillaonline.com.xpi

1435203692940 addons.xpi DEBUG Calling bootstrap method startup on wx-assistant@mozillaonline.com version 1.1.3

1435203692958 addons.manager DEBUG Registering shutdown blocker for XPIProvider

1435203692958 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager

1435203692959 addons.manager DEBUG Registering shutdown blocker for GMPProvider

1435203692959 addons.manager DEBUG Registering shutdown blocker for PluginProvider
解决方案:
1.firefox版本过高,降低版本。
2.升级selenium-server-standalone的版本。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值