Module: Selenium::WebDriver::Error

Defined in:
lib/selenium/webdriver/common/error.rb,
lib/selenium/webdriver/remote/server_error.rb

Defined Under Namespace

Classes: ElementNotDisplayedError, ElementNotSelectableError, ExpectedError, IMEEngineActivationFailedError, IMENotAvailableError, IndexOutOfBoundsError, InvalidCookieDomainError, InvalidElementCoordinatesError, InvalidElementStateError, InvalidSelectorError, MoveTargetOutOfBoundsError, NoAlertOpenError, NoCollectionError, NoScriptResultError, NoStringError, NoStringLengthError, NoStringWrapperError, NoSuchCollectionError, NoSuchDocumentError, NoSuchDriverError, NoSuchElementError, NoSuchFrameError, NoSuchWindowError, NullPointerError, ObsoleteElementError, ScriptTimeOutError, ServerError, TimeOutError, UnableToSetCookieError, UnexpectedAlertError, UnexpectedJavascriptError, UnhandledError, UnknownCommandError, UnsupportedOperationError, WebDriverError, XPathLookupError

Constant Summary collapse

Errors =
[
  IndexOutOfBoundsError,          # 1
  NoCollectionError,              # 2
  NoStringError,                  # 3
  NoStringLengthError,            # 4
  NoStringWrapperError,           # 5
  NoSuchDriverError,              # 6
  NoSuchElementError,             # 7
  NoSuchFrameError,               # 8
  UnknownCommandError,            # 9
  ObsoleteElementError,           # 10
  ElementNotDisplayedError,       # 11
  InvalidElementStateError,       # 12
  UnhandledError,                 # 13
  ExpectedError,                  # 14
  ElementNotSelectableError,      # 15
  NoSuchDocumentError,            # 16
  UnexpectedJavascriptError,      # 17
  NoScriptResultError,            # 18
  XPathLookupError,               # 19
  NoSuchCollectionError,          # 20
  TimeOutError,                   # 21
  NullPointerError,               # 22
  NoSuchWindowError,              # 23
  InvalidCookieDomainError,       # 24
  UnableToSetCookieError,         # 25
  UnexpectedAlertError,           # 26
  NoAlertOpenError,               # 27
  ScriptTimeOutError,             # 28
  InvalidElementCoordinatesError, # 29
  IMENotAvailableError,           # 30
  IMEEngineActivationFailedError, # 31
  InvalidSelectorError,           # 32
  nil,                            # 33
  MoveTargetOutOfBoundsError      # 34
]

Class Method Summary collapse

Class Method Details

.for_code(code) ⇒ Object



81
82
83
84
85
86
# File 'lib/selenium/webdriver/common/error.rb', line 81

def for_code(code)
  return if code == 0
  return WebDriverError if code.nil?

  Errors[code - 1] || WebDriverError
end