Class: Selenium::WebDriver::IE::Options
- Inherits:
-
Object
- Object
- Selenium::WebDriver::IE::Options
- Defined in:
- lib/selenium/webdriver/ie/options.rb
Constant Summary collapse
- KEY =
'se:ieOptions'.freeze
- SCROLL_TOP =
0
- SCROLL_BOTTOM =
1
- CAPABILITIES =
{ browser_attach_timeout: 'browserAttachTimeout', element_scroll_behavior: 'elementScrollBehavior', full_page_screenshot: 'ie.enableFullPageScreenshot', ensure_clean_session: 'ie.ensureCleanSession', file_upload_dialog_timeout: 'ie.fileUploadDialogTimeout', force_create_process_api: 'ie.forceCreateProcessApi', force_shell_windows_api: 'ie.forceShellWindowsApi', ignore_protected_mode_settings: 'ignoreProtectedModeSettings', ignore_zoom_level: 'ignoreZoomSetting', initial_browser_url: 'initialBrowserUrl', native_events: 'nativeEvents', persistent_hover: 'enablePersistentHover', require_window_focus: 'requireWindowFocus', use_per_process_proxy: 'ie.usePerProcessProxy', validate_cookie_document_type: 'ie.validateCookieDocumentType' }.freeze
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#add_argument(arg) ⇒ Object
Add a command-line argument to use when starting Internet Explorer.
-
#add_option(name, value) ⇒ Object
Add a new option not yet handled by these bindings.
- #as_json ⇒ Object private
-
#initialize(**opts) ⇒ Options
constructor
Create a new Options instance.
Constructor Details
#initialize(**opts) ⇒ Options
Create a new Options instance
86 87 88 89 90 |
# File 'lib/selenium/webdriver/ie/options.rb', line 86 def initialize(**opts) @args = Set.new(opts.delete(:args) || []) @options = opts @options[:native_events] ||= true end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
53 54 55 |
# File 'lib/selenium/webdriver/ie/options.rb', line 53 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
53 54 55 |
# File 'lib/selenium/webdriver/ie/options.rb', line 53 def @options end |
Instance Method Details
#add_argument(arg) ⇒ Object
Add a command-line argument to use when starting Internet Explorer.
98 99 100 |
# File 'lib/selenium/webdriver/ie/options.rb', line 98 def add_argument(arg) @args << arg end |
#add_option(name, value) ⇒ Object
Add a new option not yet handled by these bindings.
113 114 115 |
# File 'lib/selenium/webdriver/ie/options.rb', line 113 def add_option(name, value) @options[name] = value end |
#as_json ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/selenium/webdriver/ie/options.rb', line 121 def as_json(*) opts = {} CAPABILITIES.each do |capability_alias, capability_name| capability_value = @options.delete(capability_alias) opts[capability_name] = capability_value unless capability_value.nil? end opts['ie.browserCommandLineSwitches'] = @args.to_a.join(' ') if @args.any? opts.merge!(@options) {KEY => opts} end |