public class ErrorCodes
extends java.lang.Object
Constructor and Description |
---|
ErrorCodes() |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<? extends org.openqa.selenium.WebDriverException> |
getExceptionType(int statusCode)
Returns the exception type that corresponds to the given
statusCode . |
boolean |
isMappableError(java.lang.Throwable thrown)
Tests if the
thrown error can be mapped to one of WebDriver's well defined error codes. |
static java.lang.String |
toState(java.lang.Integer status) |
static int |
toStatus(java.lang.String state) |
int |
toStatusCode(java.lang.Throwable thrown)
Converts a thrown error into the corresponding status code.
|
@Beta public static final java.lang.String SUCCESS_STRING
public static final int SUCCESS
public static final int NO_SUCH_SESSION
public static final int NO_SUCH_ELEMENT
public static final int NO_SUCH_FRAME
public static final int UNKNOWN_COMMAND
public static final int STALE_ELEMENT_REFERENCE
public static final int ELEMENT_NOT_VISIBLE
public static final int INVALID_ELEMENT_STATE
public static final int UNHANDLED_ERROR
public static final int ELEMENT_NOT_SELECTABLE
public static final int JAVASCRIPT_ERROR
public static final int XPATH_LOOKUP_ERROR
public static final int TIMEOUT
public static final int NO_SUCH_WINDOW
public static final int INVALID_COOKIE_DOMAIN
public static final int UNABLE_TO_SET_COOKIE
public static final int UNEXPECTED_ALERT_PRESENT
public static final int NO_ALERT_PRESENT
public static final int ASYNC_SCRIPT_TIMEOUT
public static final int INVALID_ELEMENT_COORDINATES
public static final int IME_NOT_AVAILABLE
public static final int IME_ENGINE_ACTIVATION_FAILED
public static final int INVALID_SELECTOR_ERROR
public static final int SESSION_NOT_CREATED
public static final int MOVE_TARGET_OUT_OF_BOUNDS
public static final int INVALID_XPATH_SELECTOR
public static final int INVALID_XPATH_SELECTOR_RETURN_TYPER
public static final int METHOD_NOT_ALLOWED
private static java.util.Map<java.lang.Integer,java.lang.String> statusToState
private static java.util.Map<java.lang.String,java.lang.Integer> stateToStatus
public java.lang.Class<? extends org.openqa.selenium.WebDriverException> getExceptionType(int statusCode)
statusCode
. All unrecognized
status codes will be mapped to WebDriverException.class
.statusCode
- The status code to convert.null
if
statusCode == 0
.public int toStatusCode(java.lang.Throwable thrown)
thrown
- The thrown error.public boolean isMappableError(java.lang.Throwable thrown)
thrown
error can be mapped to one of WebDriver's well defined error codes.thrown
- The error to test.public static java.lang.String toState(java.lang.Integer status)
public static int toStatus(java.lang.String state)