TestDriver Caching Guide
A reference skill explaining how TestDriver caches AI-vision-found UI elements for fast, deterministic test replays.
Dev & CodingIntermediate★ 243⑂ 37AI score 6/10Last updated: Sep 21, 2026
What it does
- Explains how TestDriver stores each element found by
find()as a vision fingerprint (perceptual hash) for instant replays. - Documents the cache key inputs: test file SHA-256 hash, selector prompt text, screenshot context hash, and platform/browser version.
- Shows how to configure caching via
cacheKey,cacheDefaults.threshold, and per-callcacheThreshold. - Provides a debugging pattern using
element.cacheHit,cacheStrategy, andsimilarity.
Who it's for
- QA engineers and frontend developers writing E2E tests with TestDriver.
- Teams trying to cut AI vision latency and cost in CI pipelines.
- Anyone whose cache hit rate suffers from dynamic values inside prompts.
Examples
- A login test keeps re-running AI analysis → check whether the test file hash changed or the prompt text varies.
- Prompts like
input for ${email}pollute the cache → pin them withcacheKey: 'email-input'. - Matching feels too loose → tighten with
cacheThreshold: 0.01for 99% similarity.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/testdriverai/testdriverai/HEAD/ai/skills/testdriver-caching/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the ai/skills/testdriver-caching folder from the GitHub repo testdriverai/testdriverai into my ~/.claude/skills/testdriver-caching/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/testdriverai/testdriverai.git && mkdir -p ~/.claude/skills && cp -r testdriverai/ai/skills/testdriver-caching ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/testdriverai/testdriverai.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r testdriverai/ai/skills/testdriver-caching ~/.claude/skills/ - Restart Claude Code and confirm
testdriver:cachingappears in your skill list. - For real usage, install the package with
npm i testdriveraiand set theTD_API_KEYenvironment variable.