# Video & Screenshots

{% hint style="info" %}
**Who is this for?** SDETs, QA managers, and engineering managers who need to understand, access, and share the full evidence package captured during every test execution.
{% endhint %}

> **Execution evidence package:** The complete set of artifacts ContextQA captures for every test run — per-step screenshots, a session-level WebM video, an HAR network log, a browser console log, and a Playwright trace ZIP — stored per execution and accessible from the portal and via MCP tools.

When a test fails at 2 AM in a CI pipeline, the person investigating needs more than a pass/fail status. ContextQA captures a full evidence package for every execution so that failures are reproducible without re-running the test. This page describes every artifact type, how to locate and download each one from the portal, how S3 URL expiry works, and how MCP tools expose artifacts programmatically.

## What artifacts does ContextQA produce?

ContextQA produces the following artifacts for each test execution:

| Artifact            | Format     | Scope         | Description                                                                                      |
| ------------------- | ---------- | ------------- | ------------------------------------------------------------------------------------------------ |
| Step screenshots    | JPG        | Per step      | One screenshot captured at the conclusion of each test step                                      |
| Session video       | WebM       | Per test case | Full-session screen recording from browser launch to close                                       |
| Network HAR         | HAR (JSON) | Per test case | All HTTP/HTTPS requests and responses, including timing and headers                              |
| Browser console log | Text       | Per test case | All `console.log`, `console.warn`, and `console.error` output from the page                      |
| Playwright trace    | ZIP        | Per test case | Playwright's built-in trace format, viewable at trace.playwright.dev                             |
| AI reasoning log    | JSON       | Per test case | ContextQA's internal AI decision log — step interpretations, selector choices, healing decisions |

All artifacts are stored in S3-backed object storage. URLs returned by the portal and by MCP tools are pre-signed and expire after **1 hour**. Always fetch a fresh URL from the portal or via the MCP tools before attempting to download — do not cache artifact URLs between sessions.

## Screenshot capture modes

Screenshot behavior is configurable per test plan. The three modes are:

| Mode           | Behavior                                                                          | Use case                                                                          |
| -------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `ALL_TYPES`    | Screenshot captured at every step regardless of pass/fail                         | Full audit trails, compliance testing, debugging step sequences                   |
| `FAILED_STEPS` | Screenshot captured only at the failing step (and the step immediately before it) | Faster runs, reduced storage consumption for large suites                         |
| `NONE`         | No screenshots captured                                                           | Maximum speed; use only for performance benchmarking or ephemeral validation runs |

To set the screenshot mode:

1. Open **Test Plans** in the left navigation.
2. Select the test plan and click **Edit**.
3. In the plan settings step, locate the **Capture Screenshots** dropdown.
4. Select `ALL_TYPES`, `FAILED_STEPS`, or `NONE`.
5. Click **Save**.

The video recording is not affected by the screenshot mode setting — video is always captured when the plan is configured to record. Video can be disabled separately if storage cost is a concern.

## On-demand video capture during debug sessions

In addition to the automatic session recording, the interactive debugger supports on-demand video capture. While execution is paused at a step, you can click the **Capture Video** button in the simulator header to record a video clip of a specific interaction. Captured clips are available in the **Captured** view of the simulator during the live session.

After the debug execution completes, mid-session clips are replaced by the canonical full-session recording. For the complete workflow, see [Capturing video during a debug session](/execution/debugging-tests.md#capturing-video-during-a-debug-session).

## Locating artifacts in the execution report UI

After an execution completes:

1. Navigate to **Run Results** in the left navigation under **Test Plan & Results**.
2. Click the specific execution run to open the **Execution Report**.
3. Select a test case row to expand the step-level detail panel.
4. Each step row shows a thumbnail screenshot. Click the thumbnail to open the full-size JPG.
5. At the top of the case detail panel, the **Run Details** section displays the video, network HAR, console log, and Playwright trace artifacts inline.

The **Video** tab embeds the WebM player directly in the portal. Browsers that do not support WebM natively may require downloading the file and playing it locally with VLC or a compatible player.

## Downloading artifacts

**From the portal:**

* Click the download icon adjacent to each artifact tab to trigger a direct download.
* The downloaded file is the raw artifact: a `.webm` video, a `.har` JSON file, a `.zip` Playwright trace, or a `.txt` console log.

**Via MCP tools:**

ContextQA exposes six MCP tools for artifact retrieval:

| MCP Tool                     | Returns                                                         |
| ---------------------------- | --------------------------------------------------------------- |
| `get_execution_step_details` | Step-level data including screenshot URLs for each step         |
| `get_network_logs`           | The HAR content for a given execution                           |
| `get_console_logs`           | The browser console log text for a given execution              |
| `get_trace_url`              | A pre-signed S3 URL for the Playwright trace ZIP                |
| `get_ai_reasoning`           | The AI reasoning log for a given execution                      |
| `get_test_step_results`      | Pass/fail and metadata for each step, including screenshot URLs |

All URL-returning tools produce pre-signed S3 URLs. These URLs expire after **1 hour**. If you are building an automation that downloads artifacts after execution polling completes, call the relevant tool immediately after the execution status transitions to `PASSED` or `FAILED` — do not store the URL and use it later.

## Using the Playwright trace viewer

The Playwright trace is the most detailed artifact ContextQA produces. It contains:

* A DOM snapshot at every action
* Network request waterfall
* Console output timeline
* Screenshots interleaved with actions
* Test step durations

To view a trace:

1. Download the `.zip` trace file from the **Trace** artifact tab in the execution report, or retrieve the URL via the `get_trace_url` MCP tool.
2. Open [trace.playwright.dev](https://trace.playwright.dev) in any modern browser.
3. Drag and drop the `.zip` file onto the page, or click **Upload** and select the file.
4. The trace viewer opens with a full interactive timeline.

The Playwright trace viewer is a static web application — it requires no account, no login, and no ContextQA access. This makes it a portable audit artifact that can be attached to Jira tickets, shared in Slack, or archived independently of the ContextQA portal.

## S3 URL expiry and access patterns

Pre-signed S3 URLs are scoped to a single artifact and expire after **1 hour** from the time they are generated. This is a security constraint, not a content retention limit — the underlying artifact in storage persists for the duration defined by your organization's retention policy.

**Correct pattern:** Fetch the URL → download the artifact immediately.

**Incorrect pattern:** Fetch the URL → store the URL → download the artifact hours later. This will result in a 403 Forbidden response from S3.

If you are archiving artifacts to an external system (for example, an S3 bucket you control, or an evidence management tool), download the artifact immediately after receiving the URL and upload it to your target system in the same pipeline step.

## On-demand video capture in debug mode

In addition to the automatic full-session video recording, debug mode supports on-demand video capture. You can record a video clip of a specific execution segment while the debugger is paused at a breakpoint.

### Capturing a video clip

1. Start a debug session and pause execution at a breakpoint or step.
2. Click the **Capture Video** button in the live view panel header. The button is visible when execution is paused during an active debug session.
3. A progress dialog appears with the capture status:
   * **Starting** — the capture request has been sent.
   * **Capturing** — the video segment is being recorded.
   * **Ready** — the clip is available for playback.
4. Click **Watch Now** to switch to the **Captured** view, or click **Close** to dismiss.

### Live and Captured views

The live view panel header includes a **Live / Captured** toggle during debug sessions. Switch between:

* **Live** — the real-time VNC browser stream.
* **Captured** — previously captured video clips from the current session.

Clips are accumulated during the session. Automatic iteration-end clips are also appended silently when available.

### What happens when the debug session ends

When the debug execution completes, the full session video (from `screen_recordings`) replaces any mid-session clips. The full video appears in the standard execution report, accessible from the **Video** tab in the test results.

***

## Frequently Asked Questions

### Why does the video show a black screen for some steps?

This typically occurs when the test case navigates to a page that triggers a browser prompt (alert, confirm, or file chooser) before the video frame is captured. The browser renders these prompts outside the normal page compositing layer, so they appear black in WebM recordings. Screenshots at the step level are captured differently and usually show the prompt correctly.

### Can I configure ContextQA to keep artifacts for longer than the default retention period?

Artifact retention is governed by your organization's subscription tier and the storage policy configured in **Settings → Organization Settings**. Contact ContextQA support to discuss extended retention. Artifact S3 URL expiry (1 hour) is separate from artifact retention and cannot be extended — it is a security property of the pre-signed URL system.

### Does `FAILED_STEPS` screenshot mode affect the video?

No. Video recording captures the full session regardless of screenshot mode. `FAILED_STEPS` only controls which steps receive a screenshot capture event. The WebM video remains a continuous recording from session start to end.

### How large are typical evidence packages?

A 30-step test case in `ALL_TYPES` mode produces approximately 30 JPG screenshots (typically 50–200 KB each), a 5–15 MB WebM video, a 1–5 MB HAR file, and a 2–10 MB Playwright trace ZIP. For suites with hundreds of test cases, storage consumption can reach several gigabytes per execution run.

## Related

* [Running tests and test plans](/execution/running-tests.md)
* [Parallel test execution](/execution/parallel-execution.md)
* [Failure analysis and root cause](/reporting/failure-analysis.md)
* [Exporting reports](/reporting/exporting-reports.md)
* [MCP server tool reference](/mcp-server/overview.md)

{% hint style="info" %}
**10× faster with parallel execution across browsers and devices.** [**Book a Demo →**](https://contextqa.com/book-a-demo/) — See ContextQA run your full test suite in parallel CI/CD execution.
{% endhint %}


---

# 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://learning.contextqa.com/execution/video-and-screenshots.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.
