# Baseline Image Comparison

The Baseline Image Comparison feature allows users to visually analyse changes in UI or other visual elements between different executions of a test case. It helps identify layout or text-based changes by comparing newly captured screenshots with the original baseline image.

1. **Baseline Image Capture**   \
   During the first recording of a test case:
   * The system automatically captures screenshots at each step based on defined objects and actions.
   * These screenshots are saved as the Baseline Image.
   * Each step’s baseline image is displayed as a thumbnail in the test steps.
2. **New Screenshot Capture**\
   For every subsequent execution:
   * The system captures new screenshots at the same checkpoints as the baseline (based on objects and actions).
   * These are stored separately from the baseline images to enable comparison.
3. **Image Highlighting**\
   Both baseline images and new screenshots should:
   * Visually highlight the elements where actions are performed.
4. **Report Display**\
   In the test execution report:
   * For each FAILED test step, a thumbnail of the screenshot is displayed.
   * When a user clicks the thumbnail, a pop-up window shows a side-by-side comparison of the baseline image and the newly captured screenshot.
5. **Pop-up Layout**
   * Section 1: Baseline Image
     * Displays the baseline image captured during the first execution.\
       Caption: "Baseline Image"
   * Section 2: Execution Screenshot
     * **Displays the screenshot captured during the latest execution.**\
       **Caption: "Execution Screenshot"**<br>
6. **Mark as Baseline Functionality**   \
   A "Mark as Baseline" button is provided in the pop-up.
   * When clicked:
     * The new execution screenshot replaces the old baseline image.
     * The report’s thumbnail updates to reflect the new baseline.
     * The updated baseline is also reflected across all uses of the object (e.g. in other functions or test cases).
     * The new screenshot remains displayed in Section 2 for reference.
   * Confirmation Flow:
     * When the user clicks "Mark as Baseline", a confirmation pop-up appears:\
       Message: "Are you sure you want to update the baseline image?"
       * Buttons:\
         Confirm: The new screenshot is saved as the baseline image.\
         Cancel: No changes are made; the old baseline image remains.

### Benefits

* Quickly identify UI or text changes between test executions
* Simplifies maintenance by managing baselines visually
* Enhances debugging by comparing side-by-side screenshots
* Ensures consistency across objects and test cases


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.simplifyqa.ai/baseline-image-comparison.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
