← ClaudeAtlas

testdrivermaking-assertionslisted

Locate elements and verify app state with AI-powered assertions
testdriverai/testdriverai · ★ 242 · Testing & QA · score 73
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from making-assertions.mdx. DO NOT EDIT. --> Once a test runs, validate that the app did what it should. Validation has two parts: locating the elements you want to check, and making assertions about the state of your app. TestDriver uses AI as a judge, returning a boolean plus reasoning about whether your app is in the expected state. ## Locating Elements ### Locating Single Elements Use natural language to describe elements. Descriptions should be specific enough to locate the element, but not too-specific that they break with minor UI changes. For example: ```javascript await testdriver.find('email input field'); await testdriver.find('first product card in the grid'); await testdriver.find('dropdown menu labeled "Country"'); ``` <Info>TestDriver will cache found elements for improved performance on subsequent calls. Learn more about [element caching here](/v7/caching).</Info> ### Debugging Found Elements After finding an element, you can inspect its properties for debugging: ```javascript const button = await testdriver.find('submit button'); console.log(button); ``` This outputs all element properties: ```javascript { description: 'submit button', found: true, x: 150, y: 300, coordinates: { x: 150, y: 300, centerX: 200, centerY: 320 }, threshold: 0.8, confidence: 0.95, similarity: 0.92, selector: 'button[type="submit"]', cache: { hit: true, strategy: 'pixel-diff', createdAt: '2025-01-15T10:30:00Z', diffPercent