> For the complete documentation index, see [llms.txt](https://docs.qyrus.com/web-testing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qyrus.com/web-testing/advanced-features/visualtesting.md).

# Visual Testing

Visual Testing compares how your application *looks* between two runs. Qyrus screenshots each step, then holds the new run's images against an earlier run's and highlights what moved, changed or disappeared.

It catches the things a functional test cannot: a button that slid off screen, text that overflowed its box, a layout that broke at one resolution.

Visual Testing is marked **Beta** in the product.

## What it cannot do

* **It compares one script at a time.** Suite runs are not supported. The run screen tells you so: "Visual Regression can only be performed at a time on a single Script."
* **It does not work on dry runs.** Use **Execute Test**.
* **It does not work on parameterized scripts**, or on scripts edited since the baseline was made.

## Step one: create a baseline

A comparison needs something to compare against. That is the **baseline script** — a run that already passed.

1. From Test Lab or a sprint, tick your script and choose **Execute** → **Execute Test**.
2. In the run configuration, pick a browser under **Select Browser**, and set **Choose screen resolution** and **Choose environment variable**.
3. Click **Run Test**.

**Write down the browser and resolution you used.** The comparison run has to match them exactly.

Once that run passes, it is your baseline.

![The baseline run in the Executions tab](/files/sqb0PoteiWCBNta10XFm)

## Step two: run the comparison

1. Select the same script again and choose **Execute** → **Execute Test**.
2. Open the **Visual Testing** tab and switch on **Enable visual testing**.

   ![The Visual Testing tab](/files/q8OxA1qx1nZ8G0CWI1CI)
3. Select the **same browser** and the **same resolution** as the baseline. If they do not match, Qyrus has nothing valid to compare and tells you there is no previous execution available.

   ![No previous execution to compare](/files/oZdUG8GqwPVCBt3S4crC)
4. Choose the baseline script to compare against, then click **Run Test**.

   ![Selecting the baseline](/files/DUXoHtM3EQ5G7HPrbY0H)

If you selected two browsers, Qyrus asks which one to run Visual Testing in. The other browser runs as an ordinary execution.

![Choosing the browser for the comparison](/files/mg4noAI2gCd0zn4KgHd3)

## Reading the comparison

Visual Testing runs are marked with an eye icon in the report list. Open the run and go to its **Visual Testing** tab.

![The eye icon marking a visual run](/files/5pqGn5f4A7cYOEn9PsqH)

Every step appears as a screenshot. **A red boundary box means that step changed** since the baseline. Steps without one are unchanged.

![The step-by-step comparison](/files/ChSUjZAyONzdtwHkht2Z)

Click any screenshot with a red box to see the baseline and the current run side by side.

![Baseline against current](/files/396ygzZ1jBeuNTaekSbU)

The eye icon on the current execution highlights exactly what changed, in red.

![Changes highlighted](/files/BvZ79mRU6ztpHtjgrwMB)

Where nothing changed, the step reads **No Changes Detected**.

![No changes detected](/files/pIzly0napRGcIvOBYMja)

## Assertions

Assertions check visual qualities rather than comparing two runs, so they apply to the current execution only. Pick the ones you want on the run screen before executing; the report then lets you view each one against the screenshots.

![Selecting assertions](/files/VLQ6C40VAkhSG1dwxY7S)

| Assertion       | What it highlights                                                     |
| --------------- | ---------------------------------------------------------------------- |
| **DarkMode**    | Elements on screen when the script runs in dark mode, marked in yellow |
| **Overlapping** | Elements that overlap each other, marked in blue                       |
| **Contrast**    | Differences in screen brightness                                       |

**Submit Changes** clears all the assertions.

![Dark mode assertion](/files/PJ0hjWq4lgrRTn9czRX5)

![Overlapping elements assertion](/files/TptcWBekGbLHzRCed5YL)

## Where to go next

| To read about                           | Go to                                                 |
| --------------------------------------- | ----------------------------------------------------- |
| Repairing broken locators automatically | [Healer AI](/web-testing/advanced-features/healer.md) |
| Reading the rest of a run report        | [Sprint Reports](/web-testing/analyze/sprints.md)     |
