Skip to main content

Method Signature

await opensteer.input(options: InputOptions): Promise<ActionResult>
Types text into an input field or textarea. By default, clears existing content before typing.

Parameters

options
InputOptions
required
Configuration for the input action

Returns

ActionResult
Promise<ActionResult>

Examples

Basic Input

// Type into a field using AI-powered detection
await opensteer.input({
  description: 'Email address field',
  text: 'user@example.com'
})

Input with Selector

// Type using CSS selector
await opensteer.input({
  selector: '#username',
  text: 'john_doe',
  description: 'Username field'
})

Submit Form with Enter

// Type and press Enter to submit
await opensteer.input({
  description: 'Search box',
  text: 'OpenSteer documentation',
  pressEnter: true
})

Append Text

// Append to existing content without clearing
await opensteer.input({
  description: 'Message input',
  text: ' - additional text',
  clear: false
})

Input with Element Counter

// Use element counter from snapshot
await opensteer.input({
  element: 15,
  description: 'Password field',
  text: 'secure-password-123'
})

Multi-field Form

// Fill multiple form fields
await opensteer.input({
  description: 'First name',
  text: 'John'
})

await opensteer.input({
  description: 'Last name',
  text: 'Doe'
})

await opensteer.input({
  description: 'Email',
  text: 'john.doe@example.com',
  pressEnter: true
})