This topic provides information about debugging recorded tests and test scripts.
Debug Recorded Tests
TestCafe Studio's debug mode helps you understand what is happening on your web page during testing. In this mode, TestCafe Studio pauses the test and allows you to debug the tested page using the browser's developer tools. You can check the web page's state, DOM elements' location, their CSS styles, etc.
You can activate the debug mode in one of the following ways:
Add the Debug action to a particular position of a test. The test is paused when the test reaches this action.
Enable the Debug mode option for a run configuration in the Run Configurations dialog. In this case, the test is paused before the first test action.
Enable the Pause the test when it fails option for a run configuration in the Run Configurations dialog. TestCafe Studio automatically enters the debug mode when the test fails.
Once the test is paused, you can open browser's developer tools and debug.
The browser window displays the status panel during debugging. This panel allows you to resume test execution or skip to the next action.
TestCafe Studio includes features that help you find the cause of issues in your tests.
TestCafe Studio can capture screenshots during a test. You can analyze these screenshots to determine the cause of issues.
There are two ways to take screenshots:
Use the Take Screenshot action to take a screenshot in a particular place in a test.
Turn on the Take a screenshot if a test fails option for a run configuration in the Run Configurations dialog to take a screenshot when a test fails.
TestCafe Studio displays screenshots in test reports.
The Path parameter specified in the Take Screenshot action overrides this pattern. If an action with the Path parameter is executed multiple times (for instance, in different browsers or quarantine runs), all screenshots are written to the same location. As a result, screenshots are overwritten.
When a screenshot is taken because a test fails, the errors subdirectory is added to its path: