带的小弟遇到这个问题不知所措就找我解决,记录一下。
执行如下代码,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 -->
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
相关推荐
Covers basic to advanced concepts of WebDriver Learn how to design a more effective automation framework Explores all of the APIs within WebDriver Acquire an in-depth understanding of each concept...
Selenium WebDriver is an open source automation tool implemented through a browser-specific driver, which sends commands to a browser and retrieves results. The latest version of Selenium 3 brings ...
SeleniumIDE中录制的selectFrame、selectWindow命令在Junit中不支持,那么只能使用webdriver自带的命令,如下列: 1.定位到一个frame driver.switchTo().frame("menuFrame"); 2.从一个frame切换到另一个frame,如:...
webdriver API中文版 webdriver API中文版 2 1.1 下载selenium2.0的lib包 2 1.2 用webdriver打开一个浏览器 2 1.3 打开测试页面 3 1.4 GettingStarted 3 第2章 Webdirver对浏览器的支持 5 2.1 HtmlUnit Driver...
Selenium WebDriver Project on Eclipse 如何部署
Solve your Selenium WebDriver problems with this quick guide to automated testing of web applications with Selenium WebDriver in C#. Selenium WebDriver Recipes in C#, Second Edition contains hundreds ...
webdriver安装包
IE Webdriver Python
WebDriver实验版VB6版WebDriver实验,压缩包中有技术文档《WebDriver原理及实验》
php-webdriver-bindings这个PHP库允许创建功能测试与PHP webdriver
Selenium WebDriver详解及事例
本书是一本从入门到精通模式的Selenium WebDriver实战经验分享书籍。全书共分为四个部分:第1部分基础篇主要讲解自动化测试相关的基础理论、WebDriver 环境安装、单元测试工具的使用方法以及 WebDrvier的入门使用...
webdriver-helper安装包,whl版本
Selenium-Webdriver系列教程 Selenium 1.x时代已经远去,它理应躺在历史的角落里,靠着壁炉烤着火,抽着旱烟,在袅袅的升起的青烟中回忆那曾经属于自己的美好时代。 不过事实却并非如此,现今原本早应退役的...
WebDriver命令参考手册
The second edition of Mastering Selenium 3.0 WebDriver starts by showing you how to build your own Selenium framework with Maven. You’ll then look at how you can solve the difficult problems that you...
webdriver 数据驱动 webdriver 数据驱动webdriver 数据驱动webdriver 数据驱动webdriver 数据驱动webdriver 数据驱动
调用webdriver打开网页
Selenium WebDriver, also known as Selenium 2, is a UI automation tool used by software developers and QA engineers to test their web applications on different web browsers. The Selenium WebDriver API ...
ruby2.0.0+selenium-webdriver+watir-webdriver+rails离线备份,设置环境变量后可使用(未测试)