Class: Selenium::WebDriver::IE::Driver Private

Inherits:
Driver
  • Object
show all
Includes:
DriverExtensions::TakesScreenshot
Defined in:
lib/selenium/webdriver/ie/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 Internet Explorer supporting both OSS and W3C dialects of JSON wire protocol.

Constant Summary

Constants included from SearchContext

SearchContext::FINDERS

Instance Method Summary collapse

Methods included from DriverExtensions::TakesScreenshot

#save_screenshot, #screenshot_as

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.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/selenium/webdriver/ie/driver.rb', line 33

def initialize(opts = {})
  opts[:desired_capabilities] ||= Remote::Capabilities.internet_explorer

  unless opts.key?(:url)
    driver_path = opts.delete(:driver_path) || IE.driver_path
    port = opts.delete(:port) || Service::DEFAULT_PORT

    opts[:driver_opts] ||= {}
    if opts.key? :service_args
      WebDriver.logger.deprecate ':service_args', "driver_opts: {args: #{opts[:service_args]}}"
      opts[:driver_opts][:args] = opts.delete(:service_args)
    end

    %i[log_level log_file implementation].each do |method|
      next unless opts.key? method
      WebDriver.logger.deprecate ":#{method}", "driver_opts: {#{method}: '#{opts[method]}'}"
      opts[:driver_opts][method] = opts.delete(method)
    end

    @service = Service.new(driver_path, port, opts.delete(:driver_opts))
    @service.start
    opts[:url] = @service.uri
  end

  if opts.delete(:introduce_flakiness_by_ignoring_security_domains)
    opts[:desired_capabilities][:ignore_protected_mode_settings] = true
  end
  opts[:desired_capabilities][:native_events] = opts.delete(:native_events) != false

  listener = opts.delete(:listener)
  @bridge = Remote::Bridge.handshake(opts)
  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.



67
68
69
# File 'lib/selenium/webdriver/ie/driver.rb', line 67

def browser
  :internet_explorer
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.



71
72
73
74
75
# File 'lib/selenium/webdriver/ie/driver.rb', line 71

def quit
  super
ensure
  @service.stop if @service
end