ruby - Error: disable image loading on watir with firefox -
i've got error changing profile watir-webdriver. use following code disable loading images in firefox:
profile = selenium::webdriver::firefox::profile.from_name "default" profile['permissions.default.image'] = 2 browser = watir::browser.new :firefox, :profile => profile
this error message occur:
/var/lib/gems/2.3.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/remote/w3c_bridge.rb:80:in `initialize': unknown option: {:profile=>#<selenium::webdriver::firefox::profile:0x00000000e90700 @model="/home/amvisor/.mozilla/firefox/9ud9suhs.default", @native_events=false, @secure_ssl=false, @untrusted_issuer=true, @load_no_focus_lib=false, @additional_prefs={"permissions.default.image"=>2}, @extensions={}>} (argumenterror) /var/lib/gems/2.3.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/firefox/w3c_bridge.rb:34:in `initialize' /var/lib/gems/2.3.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/common/driver.rb:49:in `new' /var/lib/gems/2.3.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver/common/driver.rb:49:in `for' /var/lib/gems/2.3.0/gems/selenium-webdriver-3.0.0/lib/selenium/webdriver.rb:82:in `for' /var/lib/gems/2.3.0/gems/watir-webdriver-0.9.3/lib/watir-webdriver/browser.rb:46:in `initialize' xxx.rb:38:in `new' xxx.rb:38:in `<main>'
what means:
initialize: unknown option: {:profile
can help? thanks!
this works use existing firefox profile firefox 48+:
profile = selenium::webdriver::zipper.zip('/path/to/profile/xxx.default') caps = remote::capabilities.firefox(firefox_options: {profile: profile}) browser = watir::browser.new :firefox, desired_capabilities: caps
ruby bindings not yet support of features of firefox profiles old firefox driver in new geckodriver. if need these additional features can use firefox <48 (i recommend installing extended support release) , pass in marionette: false
in capabilities.
Comments
Post a Comment