public class ErrorCodes extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ASYNC_SCRIPT_TIMEOUT |
static int |
ELEMENT_NOT_SELECTABLE |
static int |
ELEMENT_NOT_VISIBLE |
static int |
IME_ENGINE_ACTIVATION_FAILED |
static int |
IME_NOT_AVAILABLE |
static int |
INVALID_COOKIE_DOMAIN |
static int |
INVALID_ELEMENT_COORDINATES |
static int |
INVALID_ELEMENT_STATE |
static int |
INVALID_SELECTOR_ERROR |
static int |
INVALID_XPATH_SELECTOR |
static int |
INVALID_XPATH_SELECTOR_RETURN_TYPER |
static int |
JAVASCRIPT_ERROR |
static int |
METHOD_NOT_ALLOWED |
static int |
MOVE_TARGET_OUT_OF_BOUNDS |
static int |
NO_ALERT_PRESENT |
static int |
NO_SUCH_ELEMENT |
static int |
NO_SUCH_FRAME |
static int |
NO_SUCH_SESSION |
static int |
NO_SUCH_WINDOW |
static int |
SESSION_NOT_CREATED |
static int |
STALE_ELEMENT_REFERENCE |
static int |
SUCCESS |
static String |
SUCCESS_STRING |
static int |
TIMEOUT |
static int |
UNABLE_TO_SET_COOKIE |
static int |
UNEXPECTED_ALERT_PRESENT |
static int |
UNHANDLED_ERROR |
static int |
UNKNOWN_COMMAND |
static int |
XPATH_LOOKUP_ERROR |
Constructor and Description |
---|
ErrorCodes() |
Modifier and Type | Method and Description |
---|---|
Class<? extends WebDriverException> |
getExceptionType(int statusCode)
Returns the exception type that corresponds to the given
statusCode . |
boolean |
isMappableError(Throwable thrown)
Tests if the
thrown error can be mapped to one of WebDriver's well defined error codes. |
static String |
toState(Integer status) |
static int |
toStatus(String state) |
int |
toStatusCode(Throwable thrown)
Converts a thrown error into the corresponding status code.
|
@Beta public static final 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
public Class<? extends 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(Throwable thrown)
thrown
- The thrown error.public boolean isMappableError(Throwable thrown)
thrown
error can be mapped to one of WebDriver's well defined error codes.thrown
- The error to test.public static int toStatus(String state)
Copyright © 2016. All rights reserved.