← ClaudeAtlas

testdriverextractlisted

Read information from the screen using AI and return it as a string
testdriverai/testdriverai · ★ 243 · Testing & QA · score 73
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from extract.mdx. DO NOT EDIT. --> ## Overview Get information from the screen with AI. TestDriver returns it as a string. Describe what you want in natural language. The AI reads the screen and returns the correct value: text, numbers, labels, status messages, or other content on the screen. [`assert()`](/assert) returns a boolean result. But `extract()` returns the real value. Thus you can store it, compare it, or use it in later steps and in framework assertions. ## Syntax ```javascript const value = await testdriver.extract(description) const value = await testdriver.extract({ description }) ``` ## Parameters <ParamField path="description" type="string" required> A natural language description of the information to read from the screen. </ParamField> <Info> `extract()` also accepts an options object, `extract({ description })`. This is the same as the positional form. The string form is the most common. </Info> ## Returns `Promise<string>` — The information from the screen. TestDriver returns the value as text. Parse it or cast it yourself if you need a number or another type. ## Examples ### Basic Extraction ```javascript // Read text content const title = await testdriver.extract('the page title'); const heading = await testdriver.extract('the main heading text'); // Read numbers and prices const price = await testdriver.extract('the total price shown in the cart'); const count = await testdriver.extract('the number of items in the list'