Analyze Failures with AI
Use AI to investigate failed test steps, understand the likely cause, and get a suggested fix based on the execution evidence.
The Analyze failure with AI feature can help you investigate failed test steps directly from the Results page.
Instead of reviewing the error message, screenshot, page source, and step configuration separately, you can ask Endtest to analyze the available execution evidence and explain what may have caused the failure.

Beta: AI-powered test failure analysis is currently available as a Beta feature.
How to analyze a failed step
- Open the Results page for a test execution.
- Select the Logs section.
- Locate a failed assertion or a step that returned an error.
- Click Analyze failure with AI below the failed step.
- Wait for the analysis to be generated.
The popup displays the test case and step being analyzed, along with the diagnosis and any suggested changes.
What the AI uses
Depending on the type of execution and the available evidence, Endtest can use:
- The complete error or assertion failure message.
- The test step configuration, including the action, locator, and parameters.
- The screenshot captured when the step failed.
- The page source captured at the time of the failure.
- The surrounding test and execution context.
- General knowledge about browser automation, Selenium, Appium, browser behavior, mobile applications, and common test failure patterns.
For web tests, the page source generally contains the DOM that was available when the failure occurred.
For mobile tests, the analysis can use the Appium page source and the available element information from the application interface.
The screenshot helps the AI compare what was visually displayed with what the test expected to find or verify.
Understanding the analysis
The generated response can include the following sections:
Diagnosis
A concise description of what appears to have failed.
For example, the analysis may determine that a stored locator no longer matches an element on the page.
Likely cause
An explanation of the most probable reason for the failure.
Possible causes can include:
- An incorrect or outdated locator.
- An element that was not present or visible.
- A page that had not finished loading.
- A test running in the wrong browser tab, window, or iframe.
- A different authentication or application state.
- Changed test data or environment configuration.
- A browser, driver, device, or infrastructure issue.
- An assertion that no longer matches the current application behavior.
Evidence
The specific information that supports the diagnosis.
This may include locator match counts, elements found in the page source, information visible in the screenshot, or details from the original error message.
Suggested fix
A practical recommendation for correcting the test or investigating the application.
When the AI identifies a likely replacement value, such as a new XPath or another step parameter, it can display that value separately under Use this in the step.
You can use the copy button to copy the suggested value to your clipboard.
Editing the step
Click Edit step to open the relevant test case in the test editor.
When the test case has been updated since the execution was completed, the original step may no longer have the same internal ID. In that situation, Endtest displays a warning explaining that the test case was updated and that its steps received new IDs.
The Edit step button will still open the relevant test case, but it may not automatically focus the exact historical step.
When additional information is needed
Some failures cannot be diagnosed confidently from the captured evidence alone.
For example, multiple elements may look similar, or the intended target may not be clear from the locator and screenshot. In those situations, the analysis may ask you to describe the intended element or provide additional context.
Adding details such as the visible text, role, location, or expected behavior of the element can help produce a more useful analysis.
Important considerations
AI-generated failure analysis is intended to assist with troubleshooting, but it may not always identify the exact cause.
A screenshot and page source represent the application at a specific moment in the execution. They may not include server logs, network responses, database state, application logs, or events that occurred before the evidence was captured.
Before updating a test, review the diagnosis and confirm that the suggested change matches the intended application behavior.
A failed test does not always mean that the test is incorrect. The failure may reveal a real application defect, an environment issue, or an unexpected change in the tested workflow.