Skip to content
Testing
Skill

/testdriver-click

Click at specific coordinates or on elements

From plugin
testdriverai
35665 skills1 agent

Claude Code

$ npx -y skills add testdriverai/testdriverai --skill testdriver-click --agent claude-code

SKILL.md

testdriver-click.SKILL.md
name: testdriver:click
description: Click at specific coordinates or on elements

<!-- Generated from click.mdx. DO NOT EDIT. -->

Element Click

When you call this on an Element object, it clicks on the found element.

Syntax

await element.click(action)

Parameters

<ParamField path="action" type="string" default="click"> Type of click action: `'click'`, `'double-click'`, `'right-click'`, `'hover'`, `'mouseDown'`, `'mouseUp'` </ParamField>

Returns

`Promise<void>`

Examples

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

// Double-click
const file = await testdriver.find('README.txt file');
await file.click('double-click');

// Right-click
const item = await testdriver.find('menu item');
await item.click('right-click');

// Hover (same as element.hover())
const tooltip = await testdriver.find('info icon');
await button.click('hover');

Coordinate Click

Click at specific screen coordinates.

Syntax

await testdriver.click(x, y, action)

Parameters

<ParamField path="x" type="number" required> X coordinate </ParamField>

<ParamField path="y" type="number" required> Y coordinate </ParamField>

<ParamField path="action" type="string" default="click"> Type of click: `'click'`, `'double-click'`, `'right-click'`, `'mouseDown'`, `'mouseUp'` </ParamField>

Returns

`Promise<void>`

Examples

// Click at coordinates
await testdriver.click(500, 300);

// Double-click at coordinates
await testdriver.click(500, 300, 'double-click');

// Right-click at coordinates
await testdriver.click(500, 300, 'right-click');

Click Actions

Regular Click

One left-click action.

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

Double Click

A double-click action. It usually opens files or selects text.

const file = await testdriver.find('document.pdf');
await file.click('double-click');

// Or use the dedicated method
await file.doubleClick();

Right Click

Right-click to open context menus.

const folder = await testdriver.find('Documents folder');
await folder.click('right-click');

// Or use the dedicated method
await folder.rightClick();

Mouse Down / Mouse Up

Use these for drag operations or custom click behavior.

const draggable = await testdriver.find('draggable item');
await draggable.click('mouseDown');

// Move to target
const dropZone = await testdriver.find('drop zone');
await dropZone.hover();
await dropZone.click('mouseUp');

// Or use dedicated methods
await draggable.mouseDown();
await dropZone.mouseUp();

Best Practices

<Check> **Prefer element clicks to coordinate clicks**

A click on an element is more reliable. It does not depend on the resolution:

  // ✅ Preferred
  const button = await testdriver.find('submit button');
  await button.click();
  
  // ❌ Avoid (fragile)
  await testdriver.click(500, 300);

</Check>

<Check> **Make sure that TestDriver found the element**

  const element = await testdriver.find('button');
  if (!element.found()) {
    throw new Error('Element not found');
  }
  await element.click();

</Check>

<Warning> **TestDriver must find the element before you click it**

The `find()` method finds elements automatically. But a click on an element that TestDriver did not find throws an error:

  const element = await testdriver.find('button');
  // This will throw if element wasn't found
  await element.click();

</Warning>

Use Cases

<AccordionGroup> <Accordion title="Button Clicks">

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

</Accordion>

<Accordion title="Opening Files">

    const file = await testdriver.find('report.pdf file icon');
    await file.doubleClick();

</Accordion>

<Accordion title="Context Menus">

    const item = await testdriver.find('file item');
    await item.rightClick();
    
    // Select menu option
    const deleteOption = await testdriver.find('Delete option');
    await deleteOption.click();

</Accordion>

<Accordion title="Drag and Drop">

    const source = await testdriver.find('source item');
    await source.mouseDown();
    
    const target = await testdriver.find('target zone');
    await target.hover();
    await target.mouseUp();

</Accordion> </AccordionGroup>

Complete Example

import { beforeAll, afterAll, describe, it } from 'vitest';
import TestDriver from 'testdriverai';

describe('Click Interactions', () => {
  let testdriver;

  beforeAll(async () => {
    client = new TestDriver(process.env.TD_API_KEY);
    await testdriver.auth();
    await testdriver.connect();
  });

  afterAll(async () => {
    await testdriver.disconnect();
  });

  it('should perform various click actions', async () => {
    await testdriver.focusApplication('Google Chrome');
    
    // Regular click
    const loginBtn = await testdriver.find('login button');
    await loginBtn.click();
    
    // Right-click for context menu
    const profileIcon = await testdriver.find('profile icon');
    await profileIcon.rightClick();
    
    const settingsOption = await testdriver.find('Settings menu option');
    await settingsOption.click();
    
    // Double-click to edit
    const nameField = await testdriver.find('name display field');
    await nameField.doubleClick();
    
    // Verify state
    await testdriver.assert('name field is now editable');
  });

  it('should perform drag and drop', async () => {
    const item = await testdriver.find('draggable item');
    await item.mouseDown();
Read more
@testdriverai
Ships withtestdriverai

Computer-Use SDK for E2E QA Testing

35665 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
356
Star history of testdriverai/testdriverai on GitHub, a chart by star-history.com

Other skills on testdriverai.

More skills from other plugins.

api-review

api-review

Produce the "Playwright 1.xx API Review" artifact for a range of commits - the public API additions and the breaking or behavior…

@microsoft@microsoftInstall Skill
add-e2e-selectors

add-e2e-selectors

Add reliable @grafana/e2e-selectors to interactive elements and key containers in the Grafana frontend. Use when adding e2e…

grafana5d78k
@grafana@grafanaInstall Skill
promptfoo-evals

promptfoo-evals

Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions,…

promptfoo13d27k
@promptfoo@promptfooInstall Skill
deepeval

deepeval

DeepEval evaluation workflow for AI agents and LLM applications. TRIGGER when the user wants to evaluate or improve an AI agent,…

@confident-ai@confident-aiInstall Skill

Questions about testdriver-click.

Which coding agents can use testdriver-click?
testdriver-click installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.