Module: Selenium::WebDriver::Error
Constant Summary
-
ERROR_URL =
# File 'rb/lib/selenium/webdriver/common/error.rb', line 38'https://www.selenium.dev/documentation/webdriver/troubleshooting/errors'
-
SUPPORT_MSG =
# File 'rb/lib/selenium/webdriver/common/error.rb', line 37'For documentation on this error, please visit:'
-
URLS =
# File 'rb/lib/selenium/webdriver/common/error.rb', line 40{ NoSuchElementError: "#{ERROR_URL}#no-such-element-exception", StaleElementReferenceError: "#{ERROR_URL}#stale-element-reference-exception", InvalidSelectorError: "#{ERROR_URL}#invalid-selector-exception", NoSuchDriverError: "#{ERROR_URL}/driver_location" }.freeze
Class Method Summary
-
.for_error(error)
Returns exception from its string representation.
Class Method Details
.for_error(error)
Returns exception from its string representation.
# File 'rb/lib/selenium/webdriver/common/error.rb', line 28
def self.for_error(error) return if error.nil? klass_name = error.split.map(&:capitalize).join.sub(/Error$/, '') const_get(:"#{klass_name}Error", false) rescue NameError WebDriverError end