module Selenium::WebDriver::Error

Constants

ERRORS

@api private

ElementNotDisplayedError

Raised to indicate that although an element is present on the DOM, it is not visible, and so is not able to be interacted with.

NoAlertOpenError
ObsoleteElementError

A command failed because the referenced element is no longer attached to the DOM.

ScriptTimeoutError

A script did not complete before its timeout expired.

TimeoutError

An operation did not complete before its timeout expired.

UnexpectedJavascriptError

An error occurred while executing JavaScript supplied by the user.

UnhandledError

An unknown error occurred in the remote end while processing the command.

Public Class Methods

for_code(code) click to toggle source

Returns exception from code (Integer - OSS, String - W3C). @param [Integer, String, nil] code

# File lib/selenium/webdriver/common/error.rb, line 27
def self.for_code(code)
  case code
  when nil, 0
    nil
  when Integer
    ERRORS.fetch(code)
  when String
    klass_name = code.split(' ').map(&:capitalize).join.sub(/Error$/, '')
    const_get("#{klass_name}Error", false)
  end
rescue KeyError, NameError
  WebDriverError
end