Module: Selenium::WebDriver

Defined in:
lib/selenium/webdriver.rb,
lib/selenium/webdriver/ie.rb,
lib/selenium/webdriver/edge.rb,
lib/selenium/webdriver/atoms.rb,
lib/selenium/webdriver/chrome.rb,
lib/selenium/webdriver/safari.rb,
lib/selenium/webdriver/firefox.rb,
lib/selenium/webdriver/ie/driver.rb,
lib/selenium/webdriver/phantomjs.rb,
lib/selenium/webdriver/ie/service.rb,
lib/selenium/webdriver/common/keys.rb,
lib/selenium/webdriver/common/logs.rb,
lib/selenium/webdriver/common/wait.rb,
lib/selenium/webdriver/edge/bridge.rb,
lib/selenium/webdriver/edge/driver.rb,
lib/selenium/webdriver/common/alert.rb,
lib/selenium/webdriver/common/error.rb,
lib/selenium/webdriver/common/mouse.rb,
lib/selenium/webdriver/common/proxy.rb,
lib/selenium/webdriver/edge/service.rb,
lib/selenium/webdriver/firefox/util.rb,
lib/selenium/webdriver/chrome/driver.rb,
lib/selenium/webdriver/common/driver.rb,
lib/selenium/webdriver/common/logger.rb,
lib/selenium/webdriver/common/window.rb,
lib/selenium/webdriver/common/zipper.rb,
lib/selenium/webdriver/remote/bridge.rb,
lib/selenium/webdriver/remote/driver.rb,
lib/selenium/webdriver/safari/driver.rb,
lib/selenium/webdriver/support/color.rb,
lib/selenium/webdriver/chrome/options.rb,
lib/selenium/webdriver/chrome/profile.rb,
lib/selenium/webdriver/chrome/service.rb,
lib/selenium/webdriver/common/element.rb,
lib/selenium/webdriver/common/options.rb,
lib/selenium/webdriver/common/service.rb,
lib/selenium/webdriver/firefox/binary.rb,
lib/selenium/webdriver/firefox/driver.rb,
lib/selenium/webdriver/safari/service.rb,
lib/selenium/webdriver/support/select.rb,
lib/selenium/webdriver/common/keyboard.rb,
lib/selenium/webdriver/common/platform.rb,
lib/selenium/webdriver/common/timeouts.rb,
lib/selenium/webdriver/firefox/options.rb,
lib/selenium/webdriver/firefox/profile.rb,
lib/selenium/webdriver/firefox/service.rb,
lib/selenium/webdriver/remote/response.rb,
lib/selenium/webdriver/support/escaper.rb,
lib/selenium/webdriver/common/log_entry.rb,
lib/selenium/webdriver/common/w3c_error.rb,
lib/selenium/webdriver/firefox/launcher.rb,
lib/selenium/webdriver/phantomjs/driver.rb,
lib/selenium/webdriver/remote/http/curb.rb,
lib/selenium/webdriver/common/navigation.rb,
lib/selenium/webdriver/firefox/extension.rb,
lib/selenium/webdriver/phantomjs/service.rb,
lib/selenium/webdriver/remote/oss/bridge.rb,
lib/selenium/webdriver/remote/oss/driver.rb,
lib/selenium/webdriver/remote/w3c/bridge.rb,
lib/selenium/webdriver/remote/w3c/driver.rb,
lib/selenium/webdriver/common/file_reaper.rb,
lib/selenium/webdriver/common/port_prober.rb,
lib/selenium/webdriver/common/socket_lock.rb,
lib/selenium/webdriver/common/w3c_options.rb,
lib/selenium/webdriver/remote/http/common.rb,
lib/selenium/webdriver/common/touch_screen.rb,
lib/selenium/webdriver/remote/capabilities.rb,
lib/selenium/webdriver/remote/http/default.rb,
lib/selenium/webdriver/remote/oss/commands.rb,
lib/selenium/webdriver/remote/server_error.rb,
lib/selenium/webdriver/remote/w3c/commands.rb,
lib/selenium/webdriver/common/bridge_helper.rb,
lib/selenium/webdriver/common/socket_poller.rb,
lib/selenium/webdriver/firefox/profiles_ini.rb,
lib/selenium/webdriver/common/action_builder.rb,
lib/selenium/webdriver/common/profile_helper.rb,
lib/selenium/webdriver/common/search_context.rb,
lib/selenium/webdriver/common/target_locator.rb,
lib/selenium/webdriver/firefox/legacy/driver.rb,
lib/selenium/webdriver/remote/http/persistent.rb,
lib/selenium/webdriver/remote/w3c/capabilities.rb,
lib/selenium/webdriver/common/w3c_action_builder.rb,
lib/selenium/webdriver/firefox/marionette/driver.rb,
lib/selenium/webdriver/common/html5/local_storage.rb,
lib/selenium/webdriver/common/touch_action_builder.rb,
lib/selenium/webdriver/support/event_firing_bridge.rb,
lib/selenium/webdriver/common/html5/session_storage.rb,
lib/selenium/webdriver/support/block_event_listener.rb,
lib/selenium/webdriver/common/interactions/key_input.rb,
lib/selenium/webdriver/common/interactions/none_input.rb,
lib/selenium/webdriver/common/html5/shared_web_storage.rb,
lib/selenium/webdriver/common/interactions/interaction.rb,
lib/selenium/webdriver/common/interactions/key_actions.rb,
lib/selenium/webdriver/support/abstract_event_listener.rb,
lib/selenium/webdriver/common/interactions/input_device.rb,
lib/selenium/webdriver/common/interactions/interactions.rb,
lib/selenium/webdriver/common/interactions/pointer_input.rb,
lib/selenium/webdriver/common/driver_extensions/rotatable.rb,
lib/selenium/webdriver/common/interactions/pointer_actions.rb,
lib/selenium/webdriver/common/driver_extensions/has_location.rb,
lib/selenium/webdriver/common/driver_extensions/uploads_files.rb,
lib/selenium/webdriver/common/driver_extensions/has_session_id.rb,
lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb,
lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb,
lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb,
lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb,
lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb

Defined Under Namespace

Modules: Atoms, BridgeHelper, Chrome, DriverExtensions, Edge, Error, FileReaper, Firefox, HTML5, IE, Interactions, KeyActions, Keys, PhantomJS, Platform, PointerActions, ProfileHelper, Remote, Safari, SearchContext, Support, Zipper Classes: ActionBuilder, Alert, Dimension, Driver, Element, Keyboard, Location, LogEntry, Logger, Logs, Mouse, Navigation, Options, Point, PortProber, Proxy, Rectangle, Service, SocketLock, SocketPoller, TargetLocator, Timeouts, TouchActionBuilder, TouchScreen, W3CActionBuilder, W3COptions, Wait, Window

Class Method Summary collapse

Class Method Details

.for(browser) ⇒ Driver .for(browser, opts) ⇒ Driver

Create a new Driver instance with the correct bridge for the given browser

One special argument is not passed on to the bridges, :listener. You can pass a listener for this option to get notified of WebDriver events. The passed object must respond to #call or implement the methods from AbstractEventListener.

Examples:


WebDriver.for :firefox, profile: 'some-profile'
WebDriver.for :firefox, profile: Profile.new
WebDriver.for :remote,  url: "http://localhost:4444/wd/hub", desired_capabilities: caps

Overloads:

  • .for(browser) ⇒ Driver

    Parameters:

    • browser (:ie, :internet_explorer, :edge, :remote, :chrome, :firefox, :ff, :phantomjs, :safari)

      The browser to create the driver for

  • .for(browser, opts) ⇒ Driver

    Parameters:

    • browser (:ie, :internet_explorer, :edge, :remote, :chrome, :firefox, :ff, :phantomjs, :safari)

      The browser to create the driver for

    • opts (Hash)

      Options passed to Driver.new

Returns:

See Also:



85
86
87
# File 'lib/selenium/webdriver.rb', line 85

def self.for(*args)
  WebDriver::Driver.for(*args)
end

.loggerLogger

Returns logger instance that can be used across the whole Selenium.

Returns:



95
96
97
# File 'lib/selenium/webdriver.rb', line 95

def self.logger
  @logger ||= WebDriver::Logger.new
end

.rootObject

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.



47
48
49
# File 'lib/selenium/webdriver.rb', line 47

def self.root
  @root ||= File.expand_path('../..', __FILE__)
end