Method: Selenium::WebDriver::Chromium::Options#add_preference

Defined in:
lib/selenium/webdriver/chromium/options.rb

#add_preference(name, value) ⇒ Object

Add a preference that is only applied to the user profile in use.

Examples:

Set the default homepage

options = Selenium::WebDriver::Chrome::Options.new
options.add_preference('homepage', 'http://www.seleniumhq.com/')

Parameters:

  • name (String)

    Key of the preference

  • value (Boolean, String, Integer)

    Value of the preference


158
159
160
# File 'lib/selenium/webdriver/chromium/options.rb', line 158

def add_preference(name, value)
  @options[:prefs][name] = value
end