Testdriver:Debugging With Screenshots logo

Testdriver:Debugging With Screenshots

Organization
testdriverai
testdriver:debugging-with-screenshots

Diagnose failing tests with screenshots, replays, and logs

Overview

Publishertestdriverai
Repositorytestdriverai
Skill nametestdriver:debugging-with-screenshots
Stars
465
Forks
39
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by testdriverai on GitHub. Read the source before you install it.

Installation

Install the Testdriver:Debugging With Screenshots AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-debugging-with-screenshots
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/testdriverai/testdriverai.git /tmp/testdriverai
mkdir -p .claude/skills
cp -r /tmp/testdriverai/ai/skills/testdriver-debugging-with-screenshots .claude/skills/testdriverai-testdriver-debugging-with-screenshots
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Testdriver:Debugging With Screenshots in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Testdriver:Debugging With Screenshots on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Testdriver:Debugging With Screenshots is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Overview

When a test fails, debug it. Look at what happened. Do not guess. TestDriver captures screenshots, video replays, and logs while your test runs. Thus you can replay the moment of the failure. You do not need to look at a stack trace. TestDriver MCP gives commands to view and examine the screenshots that TestDriver saved during the test. This lets you debug quickly, develop tests, and compare, without a manual open of image files.

MCP Commands

list_local_screenshots

List and filter screenshots saved in the .testdriver/screenshots/ directory:

list_local_screenshots()

Filter Parameters:

Returns:

Array of screenshot metadata including:

  • path - Full absolute path to the screenshot file
  • relativePath - Path relative to .testdriver/screenshots/
  • name - Screenshot filename
  • sizeBytes - File size in bytes
  • modified - Last modification timestamp
  • sequence - Sequential number (from auto-screenshots)
  • action - Action type (click, find, etc.)
  • phase - Before/after phase
  • lineNumber - Line number from test file
  • description - Element or action description

Example Responses:

json
// Basic listing
[
  {
    "path": "/Users/user/project/.testdriver/screenshots/login.test/001-click-before-L42-submit-button.png",
    "relativePath": "login.test/001-click-before-L42-submit-button.png",
    "name": "001-click-before-L42-submit-button.png",
    "sizeBytes": 145632,
    "modified": "2026-01-23T10:00:00.000Z",
    "sequence": 1,
    "action": "click",
    "phase": "before",
    "lineNumber": 42,
    "description": "submit-button"
  }
]

view_local_screenshot

View a specific screenshot from the list:

view_local_screenshot({ path: "/full/path/to/screenshot.png" })

Parameters:

Returns:

  • Image content (displayed to both AI and user via MCP App)
  • Screenshot metadata
  • Success/error status

Common Workflows

Test Debugging After Failures

When a test fails, you don't have to wonder what went wrong — use powerful filtering to quickly find the screenshots that show exactly what happened:

1. Find screenshots at the failing line:

// If test failed at line 42
list_local_screenshots({ line: 42 })

// View before and after states at that line
view_local_screenshot({ path: ".testdriver/screenshots/login.test/005-click-before-L42-submit-button.png" })
view_local_screenshot({ path: ".testdriver/screenshots/login.test/006-click-after-L42-submit-button.png" })

2. See what happened leading up to the failure:

// Get screenshots from lines 35-45 to see context
list_local_screenshots({ directory: "login.test", lineRange: { start: 35, end: 45 } })

3. Find all assertion screenshots:

// See what the screen looked like during assertions
list_local_screenshots({ action: "assert" })

4. View the final state before failure:

// Get the last 5 screenshots in execution order
list_local_screenshots({ directory: "login.test", sortBy: "sequence", limit: 5 })

Finding Specific Actions

When debugging element interactions:

// Find all click actions
list_local_screenshots({ action: "click" })

// Find what the screen looked like BEFORE each click
list_local_screenshots({ action: "click", phase: "before" })

// Find screenshots related to a specific element using regex
list_local_screenshots({ pattern: "submit|button" })

// Find all type actions (for form filling issues)
list_local_screenshots({ action: "type" })

Understanding Test Flow

View screenshots in execution order to trace test behavior:

// Get screenshots in execution order
list_local_screenshots({ directory: "checkout.test", sortBy: "sequence" })

// Get just the first 10 actions
list_local_screenshots({ sequenceRange: { start: 1, end: 10 }, sortBy: "sequence" })

// Get just the last 10 actions
list_local_screenshots({ directory: "checkout.test", sortBy: "sequence", limit: 10 })

Interactive Test Development

While building tests using MCP tools, view screenshots to verify your test logic:

  1. After a test run, filter screenshots to see specific actions:
// See all assertions
list_local_screenshots({ action: "assert" })

// See what happened at a specific line you're debugging
list_local_screenshots({ line: 25 })
  1. Review key points in the test execution:
view_local_screenshot({ path: ".testdriver/screenshots/my-test.test/after-login.png" })
  1. Verify element locations and states before adding assertions

  2. Iterate - adjust your test code based on what you see in the screenshots

Comparison and Analysis

Compare screenshots to identify issues:

Using phase filtering for before/after comparison:

// See state before all clicks
list_local_screenshots({ action: "click", phase: "before" })

// See state after all clicks  
list_local_screenshots({ action: "click", phase: "after" })

Using line-based debugging:

// Something went wrong around line 50
list_local_screenshots({ lineRange: { start: 45, end: 55 } })

Using regex patterns:

// Find screenshots related to login functionality
list_local_screenshots({ pattern: "login|signin|email|password" })

Best Practices

```javascript
await testdriver.screenshot("initial-page-load");
await testdriver.screenshot("after-login-click");
await testdriver.screenshot("dashboard-loaded");
```

Then when listing screenshots, you can quickly identify key moments without viewing every image.
```
list_local_screenshots({ directory: "problematic-test.test" })
```

This avoids clutter from other tests.
```bash
# Copy screenshots before next run
cp -r .testdriver/screenshots/my-test.test .testdriver/screenshots-backup/
```

Screenshot File Organization

Understanding the directory structure helps with efficient screenshot viewing:

.testdriver/
  screenshots/
    login.test/              # Test file name (without .mjs extension)
      001-find-before-L15-email-input.png     # Auto: before find() at line 15
      002-find-after-L15-email-input.png      # Auto: after find() at line 15
      003-click-before-L16-email-input.png    # Auto: before click() at line 16
      004-click-after-L16-email-input.png     # Auto: after click() at line 16
      login-complete.png                       # Manual: screenshot("login-complete")
    checkout.test/
      001-find-before-L12-add-to-cart.png
      002-find-after-L12-add-to-cart.png
      ...

Automatic Screenshot Naming Format

<seq>-<action>-<phase>-L<line>-<description>.png

ComponentDescriptionExample
seqSequential number001, 002
actionCommand nameclick, type, find
phaseBefore, after, or errorbefore, after, error
L<line>Line number from test fileL42
descriptionElement/action descriptionsubmit-button

Key Points

  • Each test file gets its own subdirectory
  • Automatic screenshots include line numbers for easy tracing
  • Manual screenshot() calls use custom names you provide
  • Folders are cleared at the start of each test run
  • All screenshots are PNG format
  • Disable automatic screenshots with autoScreenshots: false if needed

Interaction List Sidebar (Source of Truth)

When viewing a test run in the TestDriver console, the interaction list sidebar displays a screenshot for each interaction call (find, click, type, assert, etc.). These screenshots show exactly what was on the screen at the time each interaction was executed.

Use the interaction list to:

  • Verify what the AI saw — confirm the correct page/state was visible when find() or assert() ran
  • Debug misclicks — see whether the target element was actually on screen
  • Identify timing issues — spot cases where the UI hadn't finished loading before an interaction fired
  • Compare runs — review interaction screenshots across multiple runs to catch flaky behavior

Integration with Test Development

During MCP Interactive Development

When using TestDriver MCP tools (session_start, find_and_click, etc.), screenshots are automatically captured and displayed. Additionally, you can view previously saved screenshots:

# After test development session
list_local_screenshots({ directory: "my-new-test.test" })
view_local_screenshot({ path: ".testdriver/screenshots/my-new-test.test/login-page.png" })

This helps verify your test logic before running the full test file.

After Test Runs

When tests fail or behave unexpectedly, replay what happened step by step:

  1. Run the test with vitest run tests/my-test.test.mjs
  2. List screenshots using list_local_screenshots
  3. View relevant screenshots to diagnose the issue
  4. Update test code based on what you see
  5. Re-run and verify the fix

Troubleshooting

- Ensure your test includes `await testdriver.screenshot()` calls
- Verify the test actually ran (check test output)
- Check that `.testdriver/screenshots/` directory exists
- Confirm you're in the correct project directory
- Verify the path is exactly as returned by `list_local_screenshots`
- Check file permissions - ensure the screenshot file is readable
- Confirm the file hasn't been deleted or moved
- Filter by test file: `list_local_screenshots({ directory: "my-test.test" })`
- Filter by line number: `list_local_screenshots({ line: 42 })` or `list_local_screenshots({ lineRange: { start: 40, end: 50 } })`
- Filter by action: `list_local_screenshots({ action: "click" })`
- Filter by phase: `list_local_screenshots({ phase: "before" })`
- Use regex: `list_local_screenshots({ pattern: "submit|login" })`
- Limit results: `list_local_screenshots({ limit: 10 })`
- Sort by line: `list_local_screenshots({ sortBy: "line" })`
- Clean up old folders: `rm -rf .testdriver/screenshots/*`
- The test may not have run recently
- Or the test failed before reaching the clearing logic
- Manually clear: `rm -rf .testdriver/screenshots/<test-name>/`

Where this fits in the Guide

Debugging is what you reach for when a Run goes sideways or a Validate assertion fails — the screenshots show you precisely what the AI saw before it acted. Once you've diagnosed the failure, the next step is to stop it from recurring.

Related

  • screenshot() - Capture screenshots during test execution
  • Dashcam - Record full test sessions with video and logs
  • assert() - Make AI-powered assertions that benefit from screenshot context

Next

Frequently asked questions

What does the Testdriver:Debugging With Screenshots AI skill do?

Diagnose failing tests with screenshots, replays, and logs

Why use Testdriver:Debugging With Screenshots on TypingMind?

Because you install it once and use it with any model. Testdriver:Debugging With Screenshots is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Testdriver:Debugging With Screenshots in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-debugging-with-screenshots. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Testdriver:Debugging With Screenshots?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Testdriver:Debugging With Screenshots?

As many as you like. As long as a model supports skills, you can use Testdriver:Debugging With Screenshots with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Testdriver:Debugging With Screenshots AI skill free?

It is published on GitHub by testdriverai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇