> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/debugging-tests/screenshots.md).

# Screenshots

Which screenshots BugBug takes during a test run, when each one is captured, the covering element screenshot, how long screenshots are kept and how to download them.

BugBug takes screenshots automatically during every run, so you can see what the page looked like at each step and why a step failed. You don't need to configure anything.

{% hint style="info" %}
**In short**

* For each step BugBug saves a screenshot of the **whole window** and, for steps with an element, of the **element**.
* The screenshot is taken right before BugBug performs the step's action. A failed step shows the page as it was at the last attempt before the timeout.
* When an element is covered, BugBug also saves a screenshot of the **covering element**.
* Screenshots are kept as long as the run, which depends on your plan. See [Runs history](https://docs.bugbug.io/debugging-tests/runs-history.md#how-long-runs-are-kept).
  {% endhint %}

![](https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FrZjlWLhBgovJ7MVa2Yol%2Fimage.png?alt=media\&token=89bef946-142a-4c2d-b862-2cfb9bc6206a)

Click a screenshot to see the full preview.

## Which screenshots are taken

| Screenshot           | What it shows                                         | When it's taken                                                                                                                                          |
| -------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Window**           | The whole browser window.                             | Before the step's action. For steps with an element, after the element was found and right before BugBug interacts with it.                              |
| **Element**          | The step's element, cut out of the window screenshot. | Together with the window screenshot, for steps that target an element.                                                                                   |
| **Covering element** | The element that was on top of the step's element.    | When the **Element is not covered** [waiting condition](https://docs.bugbug.io/preventing-failed-tests/waiting-conditions.md) finds the element covered. |

BugBug retries a step until its [timeout](https://docs.bugbug.io/preventing-failed-tests/timeout.md) runs out, and the screenshots are refreshed on each attempt. The screenshot of a failed step therefore shows the last attempt, not the moment after the failure.

## Screenshots in the test editor

Each step in the test editor shows a screenshot of its element. It's updated after every passed run of the test, so it shows the element as it looked in the latest successful run.

## Find the screenshots of a run

Open the run in [Runs history](https://docs.bugbug.io/debugging-tests/runs-history.md) and click a step. Every run keeps its own screenshots, so you can compare a failed run with an earlier one that passed.

For a failed step, also look at the [DOM snapshot](https://docs.bugbug.io/debugging-tests/dom-snapshot.md), the [console logs](https://docs.bugbug.io/debugging-tests/console-logs.md) and the [network logs](https://docs.bugbug.io/debugging-tests/network-logs.md).

## Download screenshots

* On the Business plan, the [advanced reports](https://docs.bugbug.io/organizing-tests/reporting/advanced-reports.md) **Detailed PDF** and **ZIP with screenshots** contain the screenshot of every step.
* Through the [Public API](https://docs.bugbug.io/integrations/public-api.md) and the [MCP server](https://docs.bugbug.io/ai-testing/mcp.md), you can get the screenshots of a run.

## How long screenshots are kept

As long as the run they belong to: 7 days on Free, 1 month on Core, 2 months on Pro and 3 months on Business. They're deleted together with the run, also when you clear the history. See [Runs history](https://docs.bugbug.io/debugging-tests/runs-history.md#how-long-runs-are-kept).

## Visual regression screenshots

[Visual regression](https://docs.bugbug.io/visual-regression/review-and-fix.md) steps compare a screenshot with a saved reference. Those reference screenshots are part of the step, not of a run, and they're kept until you change or delete them.

## FAQ

<details>

<summary>When is the screenshot of a failed step taken?</summary>

Before BugBug performs the step's action, on the last attempt before the step's timeout ran out. It shows what the page looked like when BugBug was about to act, not after the failure.

</details>

<details>

<summary>What is the covering element screenshot?</summary>

A screenshot of the element that was on top of the step's element, for example a modal, cookie banner or loader. BugBug takes it when the **Element is not covered** waiting condition finds the element covered.

</details>

<details>

<summary>Is the screenshot next to a step in the editor updated after each run?</summary>

After each passed run. Failed runs don't change it; their screenshots are in the run details.

</details>

<details>

<summary>Does BugBug record video of test runs?</summary>

Not yet. BugBug saves a window and an element screenshot for every step, which you can go through step by step in the run details.

</details>

<details>

<summary>Can I delete or export screenshots?</summary>

Screenshots are deleted with their run, when it's older than your plan's history or when you clear the history. To keep them, download an advanced report with screenshots (Business plan) or get them through the API.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugbug.io/debugging-tests/screenshots.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
