TestError
Source URL: https://playwright.dev/docs/api/class-testerror
TestError | Playwright
Section titled “TestError | Playwright”Information about an error thrown during test execution.
Properties
Section titled “Properties”Added in: v1.49 testError.cause
Error cause. Set when there is a cause for the error. Will be undefined if there is no cause or if the cause is not an instance of Error.
Usage
testError.causeType
location
Section titled “location”Added in: v1.30 testError.location
Error location in the source code.
Usage
testError.locationType
message
Section titled “message”Added in: v1.10 testError.message
Error message. Set when Error (or its subclass) has been thrown.
Usage
testError.messageType
snippet
Section titled “snippet”Added in: v1.33 testError.snippet
Source code snippet with highlighted error.
Usage
testError.snippetType
Added in: v1.10 testError.stack
Error stack. Set when Error (or its subclass) has been thrown.
Usage
testError.stackType
Added in: v1.10 testError.value
The value that was thrown. Set when anything except the Error (or its subclass) has been thrown.
Usage
testError.valueType