Method: Selenium::WebDriver::Options#add_option

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

#add_option(name, value = nil) ⇒ Object

Add a new option not yet handled by bindings.

Examples:

Leave Chrome open when chromedriver is killed

options = Selenium::WebDriver::Chrome::Options.new
options.add_option(:detach, true)

Parameters:

  • name (String, Symbol)

    Name of the option

  • value (Boolean, String, Integer) (defaults to: nil)

    Value of the option

[View source]

89
90
91
92
# File 'lib/selenium/webdriver/common/options.rb', line 89

def add_option(name, value = nil)
  name, value = name.first if value.nil? && name.is_a?(Hash)
  @options[name] = value
end