Skip to main content

Method Signature

await opensteer.click(options: ClickOptions): Promise<ActionResult>
Clicks on an element in the browser. Supports left, right, middle clicks, double-clicks, and modifier keys.

Parameters

options
ClickOptions
required
Configuration for the click action

Returns

ActionResult
Promise<ActionResult>

Examples

Basic Click

// Click using AI-powered element detection
await opensteer.click({
  description: 'Submit button'
})

Click with Selector

// Click using CSS selector
await opensteer.click({
  selector: '#submit-btn',
  description: 'Submit button'
})

Right Click

// Right-click to open context menu
await opensteer.click({
  description: 'File item',
  button: 'right'
})

Double Click

// Double-click to select word
await opensteer.click({
  description: 'Text editor',
  clickCount: 2
})

Click with Modifiers

// Ctrl+Click for multi-select
await opensteer.click({
  description: 'List item 3',
  modifiers: ['Control']
})

// Shift+Click to select range
await opensteer.click({
  description: 'Last item',
  modifiers: ['Shift']
})

Click with Element Counter

// Use element counter from snapshot
await opensteer.click({
  element: 42,
  description: 'Login button'
})
  • hover - Hover over elements without clicking
  • input - Fill text into input fields
  • select - Select dropdown options