Debugging UI tests
In Chapter 4, Running Karate Tests, we saw Karate’s powerful debugging features in combination with VS Code. We will now see that we can also use the same techniques when dealing with browser tests.
Note that these are techniques and approaches that can be used in all supported browsers. If you want to know more options that are specific to the target browser and driver in use—for example, video recording with the Karate Docker image—please refer to this section of the official documentation: https://github.com/karatelabs/karate/tree/master/karate-core#configure-drivertarget.
Let’s now explore which debugging options Karate offers to simplify and speed up browser test development.
Taking screenshots
Karate will automatically take a screenshot if a test fails. This screenshot is automatically attached to the test report and can be seen by clicking on the failed step of the test. This makes it easier to debug the cause of the...