Module: Selenium::WebDriver::Error

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

Defined Under Namespace

Classes: ElementNotSelectableError, ElementNotVisibleError, ExpectedError, IMEEngineActivationFailedError, IMENotAvailableError, IndexOutOfBoundsError, InvalidCookieDomainError, InvalidElementCoordinatesError, InvalidElementStateError, InvalidSelectorError, JavascriptError, MoveTargetOutOfBoundsError, NoAlertPresentError, NoCollectionError, NoScriptResultError, NoStringError, NoStringLengthError, NoStringWrapperError, NoSuchCollectionError, NoSuchDocumentError, NoSuchDriverError, NoSuchElementError, NoSuchFrameError, NoSuchWindowError, NullPointerError, ScriptTimeOutError, ServerError, StaleElementReferenceError, TimeOutError, UnableToSetCookieError, UnhandledAlertError, UnknownCommandError, UnknownError, UnsupportedOperationError, WebDriverError, XPathLookupError

Constant Summary collapse

Errors =

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

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

aliased for backwards compatibility

StaleElementReferenceError
UnhandledError =

aliased for backwards compatibility

UnknownError
UnexpectedJavascriptError =

aliased for backwards compatibility

JavascriptError
NoAlertOpenError =

aliased for backwards compatibility

NoAlertPresentError
ElementNotDisplayedError =

aliased for backwards compatibility

ElementNotVisibleError

Class Method Summary collapse

Class Method Details

.for_code(code) ⇒ Object


206
207
208
209
210
211
# File 'lib/selenium/webdriver/common/error.rb', line 206

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

  Errors[code - 1] || WebDriverError
end