123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::IE::Options

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Selenium::WebDriver::Options
Defined in: rb/lib/selenium/webdriver/ie/options.rb

Constant Summary

::Selenium::WebDriver::Options - Inherited

GRID_OPTIONS, W3C_OPTIONS

Class Attribute Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::Selenium::WebDriver::Options - Inherited

Constructor Details

.new(**opts) ⇒ Options

Create a new Options instance

Examples:

options = Selenium::WebDriver::IE::Options.new(args: ['--host=127.0.0.1'])
driver = Selenium::WebDriver.for(:ie, options: options)
options = Selenium::WebDriver::IE::Options.new
options.element_scroll_behavior = Selenium::WebDriver::IE::Options::SCROLL_BOTTOM
driver = Selenium::WebDriver.for(:ie, options: options)

Parameters:

  • opts (Hash)

    the pre-defined options

Options Hash (**opts):

  • args (Array<String>)
  • browser_attach_timeout (Integer)
  • element_scroll_behavior (Integer)

    Either SCROLL_TOP or SCROLL_BOTTOM

  • full_page_screenshot (Boolean)
  • ensure_clean_session (Boolean)
  • file_upload_dialog_timeout (Integer)
  • force_create_process_api (Boolean)
  • force_shell_windows_api (Boolean)
  • ignore_protected_mode_settings (Boolean)
  • ignore_zoom_level (Boolean)
  • initial_browser_url (String)
  • native_events (Boolean)
  • persistent_hover (Boolean)
  • require_window_focus (Boolean)
  • use_per_process_proxy (Boolean)
  • validate_cookie_document_type (Boolean)
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/ie/options.rb', line 83

def initialize(**opts)
  @args = (opts.delete(:args) || []).to_set
  super

  @options[:native_events] = true if @options[:native_events].nil?
end

Instance Attribute Details

#args (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/ie/options.rb', line 50

attr_reader :args

Instance Method Details

#add_argument(arg)

Add a command-line argument to use when starting Internet Explorer.

Parameters:

  • arg (String)

    The command-line argument to add

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/ie/options.rb', line 96

def add_argument(arg)
  @args << arg
end

#process_browser_options(browser_options) (private)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/ie/options.rb', line 102

def process_browser_options(browser_options)
  options = browser_options[KEY]
  options['ie.browserCommandLineSwitches'] = @args.to_a.join(' ') if @args.any?
end