mcpbeat Sign in

Testdriver:performing Actions Agent Skill

Perform actions and handle dynamic, async UI so tests adapt to change

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
237
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/testdriverai/testdriverai --skill testdriver:performing-actions

The instruction itself

5 sections, as written by the author

<!-- Generated from performing-actions.mdx. DO NOT EDIT. -->

Real apps move, load, and change. Adapt your tests to handle it.

Once you've generated and learned your tests and gotten them running, the next challenge is the real world: buttons appear after a spinner, pages navigate, animations play, and content streams in over the network. To keep tests reliable, you need to perform the right actions and handle timing so your tests adapt to how the UI actually behaves instead of breaking.

Performing Actions

TestDriver provides a variety of actions you can perform, like clicking, typing, hovering, and scrolling. For a full list, see the API Reference.

// Clicking
await testdriver.find('submit button').click();
await testdriver.find('file item').doubleClick();
await testdriver.find('text area').rightClick();

// Typing
await testdriver.find('email input').type('[email protected]');
await testdriver.find('password input').type('secret', { secret: true });

// Keyboard shortcuts
await testdriver.pressKeys(['enter']);
await testdriver.pressKeys(['ctrl', 'c']);

// Hovering
await testdriver.find('dropdown menu').hover();

// Scrolling
await testdriver.scroll('down', 500);

// Waiting
await testdriver.wait(2000); // Wait 2 seconds for animation/state change

// Extracting information from screen
const price = await testdriver.extract('the total price');
const orderNumber = await testdriver.extract('the order confirmation number');

Chaining Actions

TestDriver supports method chaining for cleaner code:

// Chain find() with actions
const button = await testdriver.find('submit button').click();

Or save element reference for later use:

const button = await testdriver.find('submit button');
await button.click();

Waiting for Dynamic Content

By default, find() automatically polls for up to 10 seconds, retrying every 5 seconds until the element is found. This means most elements that appear after short async operations will be found without any extra configuration.

For longer operations, increase the timeout:

// Default behavior - polls for up to 10 seconds automatically
const element = await testdriver.find('Loading complete indicator');
await element.click();

// Wait up to 30 seconds for slower operations
const element = await testdriver.find('Loading complete indicator', { timeout: 30000 });
await element.click();

// Useful after actions that trigger loading states
await testdriver.find('submit button').click();
await testdriver.find('success message', { timeout: 15000 });

// Disable polling for instant checks
const toast = await testdriver.find('notification toast', { timeout: 0 });

Flake Prevention

TestDriver automatically waits for the screen and network to stabilize after each action using redraw detection. This prevents flaky tests caused by animations, loading states, or dynamic content updates.

<Note>

Redraw detection adds a small delay after each action but significantly reduces test flakiness.

</Note>

For example, when clicking a submit button that navigates to a new page:

// Click submit - TestDriver automatically waits for the new page to load
await testdriver.find('submit button').click();

// By the time this runs, the page has fully loaded and stabilized
await testdriver.assert('dashboard is displayed');
await testdriver.find('welcome message');

Without redraw detection, you'd need manual waits or retries to handle the page transition. TestDriver handles this automatically by detecting when the screen stops changing and network requests complete.

You can disable redraw detection or customize its behavior:

// Disable redraw detection for faster tests (less reliable)
const testdriver = TestDriver(context, { 
  redraw: false 
});

Here is an example of customizing redraw detection:

// Fine-tune redraw detection
const testdriver = TestDriver(context, { 
  redraw: {
    enabled: true,
    diffThreshold: 0.1,      // Pixel difference threshold (0-1)
    screenRedraw: true,      // Monitor screen changes
    networkMonitor: true,    // Wait for network idle
  }
});

Simple Delays with wait()

For simple pauses — waiting for animations, transitions, or state changes after an action — use wait():

// Wait for an animation to complete
await testdriver.find('menu toggle').click();
await testdriver.wait(2000);

// Wait for a page transition to settle
await testdriver.find('next page button').click();
await testdriver.wait(1000);

<Note>

For waiting for specific elements to appear, prefer find() with a timeout option. Use wait() only for simple time-based pauses.

</Note>

Once your tests can reliably act on a changing UI and assert the results, the next step is figuring out what happened when something does go wrong.

<Card title="Next: Debug" icon="bug" href="/v7/debugging-with-screenshots">

Use screenshots and run output to see exactly what your test saw and pinpoint failures.

</Card>

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take testdriverai/testdriver:performing-actions from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.