Class: Selenium::WebDriver::Firefox::Marionette::Driver Private

Inherits:
Driver
  • Object
show all
Includes:
DriverExtensions::HasAddons, DriverExtensions::HasWebStorage, DriverExtensions::TakesScreenshot
Defined in:
lib/selenium/webdriver/firefox/marionette/driver.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Driver implementation for Firefox using GeckoDriver.

Constant Summary

Constants included from SearchContext

SearchContext::FINDERS

Instance Method Summary collapse

Methods included from DriverExtensions::TakesScreenshot

#save_screenshot, #screenshot_as

Methods included from DriverExtensions::HasWebStorage

#local_storage, #session_storage

Methods included from DriverExtensions::HasAddons

#install_addon, #uninstall_addon

Methods inherited from Driver

#[], #action, #capabilities, #close, #current_url, #execute_async_script, #execute_script, for, #get, #inspect, #keyboard, #manage, #mouse, #navigate, #page_source, #ref, #switch_to, #title, #window_handle, #window_handles

Methods included from SearchContext

#find_element, #find_elements

Constructor Details

#initialize(opts = {}) ⇒ Driver

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.

Returns a new instance of Driver.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/selenium/webdriver/firefox/marionette/driver.rb', line 35

def initialize(opts = {})
  opts[:desired_capabilities] = create_capabilities(opts)

  opts[:url] ||= service_url(opts)

  listener = opts.delete(:listener)
  WebDriver.logger.info 'Skipping handshake as we know it is W3C.'
  desired_capabilities = opts.delete(:desired_capabilities)
  bridge = Remote::Bridge.new(opts)
  capabilities = bridge.create_session(desired_capabilities)
  @bridge = Remote::W3C::Bridge.new(capabilities, bridge.session_id, opts)
  @bridge.extend Marionette::Bridge

  super(@bridge, listener: listener)
end

Instance Method Details

#browserObject

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.



51
52
53
# File 'lib/selenium/webdriver/firefox/marionette/driver.rb', line 51

def browser
  :firefox
end

#quitObject

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.



55
56
57
58
59
# File 'lib/selenium/webdriver/firefox/marionette/driver.rb', line 55

def quit
  super
ensure
  @service&.stop
end