下一代码从irb正常工作:
require 'rubygems'require 'watir-webdriver'require 'headless'headless.ly do browser = Watir::browser.new :firefox browser.goto "Google.com" browser.closeend
如果我尝试从rails应用程序运行它有下一个问题:
的Gemfile:
gem 'headless'gem 'watir-webdriver'
行动:
def test_action headless.ly do browser = Watir::browser.new(:firefox) browser.goto "Google.com" browser.close endend
有下一个输出:
no such file to load -- { "froZen": { "app.update.auto": false,"app.update.enabled": false,"browser.download.manager.showWhenStarting": false,"browser.EulA.overrIDe": true,"browser.EulA.3.accepted": true,"browser.link.open_external": 2,"browser.link.open_newwindow": 2,"browser.offline": false,"browser.safebrowsing.enabled": false,"browser.safebrowsing.malware.enabled": false,"browser.search.update": false,"browser.sessionstore.resume_from_crash": false,"browser.shell.checkDefaultbrowser": false,"browser.tabs.warnOnClose": false,"browser.tabs.warnOnopen": false,"devtools.errorconsole.enabled": true,"dom.disable_open_during_load": false,"extensions.autodisableScopes": 10,"extensions.logging.enabled": true,"extensions.update.enabled": false,"extensions.update.notifyUser": false,"network.manage-offline-status": false,"network.http.phishy-userpass-length": 255,"offline-apps.allow_by_default": true,"prompts.tab_modal.enabled": false,"security.fileuri.origin_policy": 3,"security.fileuri.strict_origin_policy": false,"security.warn_entering_secure": false,"security.warn_entering_secure.show_once": false,"security.warn_entering_weak": false,"security.warn_entering_weak.show_once": false,"security.warn_leaving_secure": false,"security.warn_leaving_secure.show_once": false,"security.warn_submit_insecure": false,"security.warn_vIEwing_mixed": false,"security.warn_vIEwing_mixed.show_once": false,"signon.rememberSignons": false,"toolkit.networkmanager.disable": true,"toolkit.telemetry.prompted": 2,"toolkit.telemetry.enabled": false,"toolkit.telemetry.rejected": true },"mutable": { "browser.dom.window.dump.enabled": true,"browser.startup.page": 0,"browser.startup.homepage": "about:blank","dom.max_script_run_time": 30,"dom.report_all_Js_exceptions": true,"JavaScript.options.showInConsole": true,"network.http.max-connections-per-server": 10,"webdriver_accept_untrusted_certs": true,"webdriver_assume_untrusted_issuer": true }}
哪里有问题?
解决方法 我的项目与你有同样的错误我发现这个问题是由宝石“selenium-webdriver”所引发的
而且版本应为’2.20.0′
如果gem的版本高于此值,则会发生此错误
总结以上是内存溢出为你收集整理的ruby-on-rails-3 – 在rails动作中启动Watir-Webdriver全部内容,希望文章能够帮你解决ruby-on-rails-3 – 在rails动作中启动Watir-Webdriver所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)