testdrivercachinglisted
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from caching.mdx. DO NOT EDIT. -->
Once the agent has [explored your app](/v7/generating-tests), TestDriver remembers what it found. Every element the AI vision agent discovers is cached with a vision fingerprint—a perceptual hash of the screen state where it was located. On the next run, TestDriver matches against that cache instead of calling the AI again. Passing tests replay instantly, deterministically, and cheaply.
This learning is what makes TestDriver fast. Intelligent caching delivers up to **1.7x faster** test execution by skipping redundant AI vision analysis—the agent only thinks when it sees something new.
```javascript
// First run: builds cache
await testdriver.find('submit button');
// Second run: exact match
await testdriver.find('submit button');
```
## Automatic Caching
Learning is enabled automatically with zero configuration. The cache key—the fingerprint TestDriver uses to recognize what it already knows—is computed from:
- **File hash**: SHA-256 hash of the test file contents
- **Selector prompt**: The exact text description passed to `find()`
- **Screenshot context**: Perceptual hash of the current screen state
- **Platform**: Operating system and browser version
When you modify your test file, the hash changes automatically, invalidating stale cache entries and ensuring fresh AI analysis with your updated test logic.
```javascript
import { test } from 'vitest';
import { chrome } from 'testdriverai/presets';
test('auto-cached