Skip to main content
The Tap On Elements command (Command Type: 5) selects elements by a given CSS selector, calculates their position on screen, and taps on them.

Command Type

Command Type ID: 5

Parameters

ParameterTypeDescriptionRequired
selectorstringThe CSS selector to identify the element(s) to tapYes
timeoutnumberThe timeout for the command in millisecondsYes
filtersFiltersOptional filters to refine the elements to tapNo
viewportAreaPercentagenumberPercentage of the viewport area (0–100) used to decide which part of the element to tapNo

Filters Object

FieldTypeDescriptionRequired
classNamestringFilter elements by a specific class nameNo
includeInnerTextArray of stringInclude elements whose inner text contains any of the specified stringsNo
excludeInnerTextArray of stringExclude elements whose inner text contains any of the specified stringsNo

Usage Examples

Tap a Button

{
  "command": "tap-on-elements",
  "params": {
    "selector": "button.submit",
    "timeout": 10000
  }
}

Tap with Inner Text Filter

{
  "command": "tap-on-elements",
  "params": {
    "selector": ".list-item",
    "timeout": 10000,
    "filters": {
      "includeInnerText": ["Accept"]
    }
  }
}