Class: Selenium::WebDriver::EdgeHtml::Options

Inherits:
Options
  • Object
show all
Defined in:
build/rb/lib/selenium/webdriver/edge_html/options.rb

Constant Summary collapse

CAPABILITIES =
{in_private: 'ms:inPrivate',
extension_paths: 'ms:extensionPaths',
start_page: 'ms:startPage'}.freeze
BROWSER =
'MicrosoftEdge'

Constants inherited from Options

Options::W3C_OPTIONS

Instance Attribute Summary

Attributes inherited from Options

#options

Instance Method Summary collapse

Methods inherited from Options

#add_option, #as_json, set_capabilities

Constructor Details

#initialize(**opts) ⇒ Options

Create a new Options instance for Edge.

Examples:

options = Selenium::WebDriver::Edge::Options.new(in_private: true)
driver = Selenium::WebDriver.for :edge, options: options

Parameters:

  • opts (Hash)

    the pre-defined options to create the Edge::Options with

Options Hash (**opts):

  • :in_private (Boolean)

    Start in private mode. Default is false

  • :extension_paths (Array<String>)

    A list of full paths to extensions to install on startup

  • :start_page (String)

    Default page to start with

See Also:



55
56
57
58
# File 'build/rb/lib/selenium/webdriver/edge_html/options.rb', line 55

def initialize(**opts)
  super(**opts)
  @options[:extensions]&.each(&method(:validate_extension))
end

Instance Method Details

#add_extension_path(path) ⇒ Object

Add an extension by local path.

Examples:

options = Selenium::WebDriver::Edge::Options.new
options.add_extension_path('C:\path\to\extension')

Parameters:

  • path (String)

    The local path to the extension folder



70
71
72
73
74
# File 'build/rb/lib/selenium/webdriver/edge_html/options.rb', line 70

def add_extension_path(path)
  validate_extension(path)
  @options[:extension_paths] ||= []
  @options[:extension_paths] << path
end