Search⌘ K
AI Features

Execute Failing Tests in Command Prompt

Explore how to deliberately cause Selenium Java tests to fail and run them via the command prompt. Learn to examine the failure details including exception messages, stack traces, and generated screenshots. Understand how Maven test execution logs provide useful insights for debugging and improving your automated tests locally.

To make tests fail, we will modify the data-key attribute of the PAGINATION_TEXT_XPATH locator from the ResultsPage class by adding 1 to its value:

Java
By PAGINATION_TEXT_XPATH = By.xpath("//span[@data-key = 'pagination-text1']");

Run tests

Next, we run the ...