How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Click at specific coordinates or on elements
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
When you call this on an Element object, it clicks on the found element.
await element.click(action)
Promise<void>
// 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');
Click at specific screen coordinates.
await testdriver.click(x, y, action)
Promise<void>
// 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');
One left-click action.
const button = await testdriver.find('Login button');
await button.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 to open context menus.
const folder = await testdriver.find('Documents folder');
await folder.click('right-click');
// Or use the dedicated method
await folder.rightClick();
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();
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>
const cancelBtn = await testdriver.find('cancel button');
await cancelBtn.click();
```
</Accordion>
<Accordion title="Opening Files">
```javascript
const file = await testdriver.find('report.pdf file icon');
await file.doubleClick();
```
</Accordion>
<Accordion title="Context Menus">
```javascript
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">
```javascript
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>
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();
// Drag to new location
const dropTarget = await testdriver.find('drop area');
await dropTarget.hover();
await dropTarget.mouseUp();
// Verify
await testdriver.assert('item is in the drop area');
});
});
find() - Find elements to clickhover() - Put the cursor on the element without a clickdoubleClick() - The double-click methodrightClick() - The right-click method아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Execute natural language tasks using AI
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Make AI-powered assertions about screen state
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Deploy TestDriver on your AWS infrastructure using CloudFormation
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Speed up tests with screenshot-based caching
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
How TestDriver learns your app and caches what it discovers for instant, deterministic replays
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.