Principle:DevExpress Testcafe Test Run Error Taxonomy
| Knowledge Sources | |
|---|---|
| Domains | Error_Handling, Testing |
| Last Updated | 2026-02-12 12:00 GMT |
Overview
Principle governing the structured classification and hierarchy of test run errors in TestCafe, enabling precise error identification, reporting, and formatting across both client and server.
Description
TestCafe uses a hierarchical error class system where all test run errors extend a common TestRunErrorBase. Each error carries a unique error code (from the TEST_RUN_ERRORS enum), an isTestCafeError flag, and an optional callsite for error location. The taxonomy covers: client function errors, selector errors, uncaught page errors, action option validation errors (type/range checking), action execution errors (element not found, invisible, wrong type), iframe/window errors, and native dialog errors. This structured approach enables precise error formatting in reporters and consistent error handling across the browser-server boundary.
Usage
This principle applies when understanding test failure diagnostics, implementing custom reporters, or extending TestCafe's error handling. The error codes map directly to error message templates for user-facing reporting.
Theoretical Basis
The error taxonomy follows a class hierarchy pattern:
# Abstract error hierarchy
TestRunErrorBase(code, callsite)
├── ActionOptionErrorBase(code, optionName, actualValue)
│ ├── ActionIntegerOptionError
│ ├── ActionSpeedOptionError
│ └── ... (type validation errors)
├── SelectorErrorBase(code, apiFnChain, apiFnIndex, reason)
│ ├── ActionElementNotFoundError
│ ├── ActionElementIsInvisibleError
│ └── ... (element resolution errors)
├── ClientFunctionExecutionInterruptionError
├── UncaughtErrorOnPage(errorInfo, pageUrl)
├── UncaughtErrorInClientFunctionCode
├── WindowNotFoundError
└── NativeDialogNotHandledError
Each error code maps to a message template, and the structured data enables reporters to format context-specific diagnostic information.