Overview

The TYPE step simulates keyboard input to enter text into input fields, text areas, and any other text-accepting elements. It supports various options for handling existing content and keyboard events.

Parameters

targetDescription
string
required
Element selector for the input field. Supports CSS selectors, XPath, and other selector formats.
value
string
required
Text to type into the field. Supports variable interpolation.
delay
number
Delay between keystrokes in milliseconds for more realistic typing
replaceContent
boolean
Clear existing content before typing new text
pressEnter
boolean
default:"false"
Press Enter key after typing the text

Behavior

  1. Element Location: Finds the input element using the provided selector
  2. Focus Element: Ensures the element has focus
  3. Clear Content: Optionally clears existing content if replaceContent is true
  4. Type Text: Types the text character by character
  5. Keystroke Delay: Applies optional delay between keystrokes
  6. Fire Events: Triggers appropriate input and change events
  7. Enter Key: Optionally presses Enter key after typing

Common Use Cases

  • Filling out form fields (username, password, email)
  • Entering search queries
  • Typing in text areas for comments or descriptions
  • Updating existing field values
  • Submitting forms by pressing Enter

Advanced Usage

With Variables

{
  "type": "TYPE",
  "targetDescription": "#email-input",
  "value": "{{userEmail}}",
  "replaceContent": true
}

With Keystroke Delay

{
  "type": "TYPE",
  "targetDescription": "#search-box",
  "value": "slow typing simulation",
  "delay": 100
}

Error Handling

The step will fail if:
  • The element cannot be found using the selector
  • The element is not a valid input field
  • The element is disabled or read-only
  • The element is not visible
Clear error messages are provided to help debug selector or element state issues.