Skip to main content
The Click by Javascript command (Command Type: 3) selects elements using an ElementsLocator and clicks them programmatically via JavaScript’s element.click().

Command Type

Command Type ID: 3

Parameters

ParameterTypeDescriptionRequired
elementsLocatorElementsLocatorDefines how to locate the target elementsYes
timeoutnumberTimeout for the command in millisecondsYes

ElementsLocator

FieldTypeDescriptionRequired
selectorstringCSS selector (used with document.querySelectorAll())Yes
continueWithElementsLocatorContinue search within the found elementNo
hasChildrenElementsLocatorFilter elements that have children matching this locatorNo
indexnumberSelect a specific element by index when multiple matchNo
innerTextstringFilter elements by inner textNo

Usage Examples

Click a Tab

{
  "command": "click-by-javascript",
  "params": {
    "elementsLocator": { "selector": "[data-test='tab--football']" },
    "timeout": 10000
  }
}

Click by Inner Text

{
  "command": "click-by-javascript",
  "params": {
    "elementsLocator": {
      "selector": ".nav-item",
      "innerText": "Live"
    },
    "timeout": 10000
  }
}