watir-webdriver启动Firefox遇到unable to find profile named: "default"
2013-07-23 11:51
543 查看
谷歌了一下,貌似没人遇到这样的情况,我在这记录一下吧:
更新火狐到22版本,发现加了很多乱七八糟的插件,同事启动Firefox会卡住脚本,没办法,只能屏蔽掉这些插件。但是我们会发现,你手动打开的Firefox和脚本启动的Firefox是不一样的,我手动修改了配置保存了,脚本启动的火狐依然是最初的设置,尝试了一些方法,比如add_extensions方法什么的都不行。
后来发现,其实只需要手动修改一下配置,然后profile用default就可以了。
按照官方的例子写:
不过今天有发现个新问题,就是有部分机器运行的时候会提示如下错误:
解决办法:
更新火狐到22版本,发现加了很多乱七八糟的插件,同事启动Firefox会卡住脚本,没办法,只能屏蔽掉这些插件。但是我们会发现,你手动打开的Firefox和脚本启动的Firefox是不一样的,我手动修改了配置保存了,脚本启动的火狐依然是最初的设置,尝试了一些方法,比如add_extensions方法什么的都不行。
后来发现,其实只需要手动修改一下配置,然后profile用default就可以了。
按照官方的例子写:
Watir::Browser.new :firefox, :profile => 'default'
不过今天有发现个新问题,就是有部分机器运行的时候会提示如下错误:
D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/firefox/launcher.rb:88:in `fetch_profile': unable to find profile named: "default" (Selenium::WebDriver::Error::WebDriverError) from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/firefox/launcher.rb:53:in `create_profile' from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/firefox/launcher.rb:34:in `block in launch' from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked' from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/firefox/launcher.rb:32:in `launch' from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/firefox/bridge.rb:24:in `initialize' from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/common/driver.rb:31:in `new' from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/common/driver.rb:31:in `for' from D:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver.rb:67:in `for' from D:/ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-webdriver/browser.rb:46:in `initialize'
解决办法:
default_profile=Selenium::WebDriver::Firefox::Profile.from_name "default" b = Watir::Browser.new :firefox, :profile => default_profile
相关文章推荐
- "无法启动Web服务器。Web服务器无法找到请求的资源" 或 "unable to start debugging on the web server.the web server could not find the request"解决方法
- WebDriverException: Cannot find firefox binary in PATH."的解决方法
- Problem with driver "Derby Embedded JDBC Driver 10.0 Default." (Error: Unable to locate JAR/zip in f
- 记录一下解决webdriver启动浏览器报“Unable to find a free port”问题的方法
- 升级Firefox8后watir-webdriver出现错误“unable to obtain stable firefox connection in 60 seconds”
- 【Webdriver】Firefox启动后出现Unable to connect to host 127.0.0.1 on port 7055。
- apache启动失败:Name or service not known: mod_unique_id: unable to find IPv4 address of "narkii"
- Unable to find a value for "dwmc" in object of class "java.lang.String" using operator "." (null
- Selenium2(WebDriver)总结(一)---启动浏览器、设置profile&加载插件
- Selenium2(WebDriver):启动浏览器、设置profile&加载插件
- Solution for "De-serialization exception: Unable to find assembly xxxxx"
- <Error> <Server> <BEA-002606> <Unable to create a server socket for listening on channel "Default[2
- "BEA-000450" "Unable to find internal data record for the socket"
- Unable to find a value for "tStatus" in object of class org.entity.Passport using operator "."
- Selenium2(WebDriver)总结(一)---启动浏览器、设置profile&加载插件
- Unable to find a value for "字段名" in object of class java.lang.String using operator "."
- Selenium2(WebDriver)总结(一)---启动不同浏览器、设置profile&加载插件
- Unable to find script library '/aspnet_client/system-web/1-1-4322/webvalidation.js'
- 【从翻译mos文章】Weblogic AdminServer 启动fail,报错"unable to get file lock, will retry"
- 错误"Unable to find manifest signing certificate in the certificate store"的解决方法