Skip to main content
The Get Elements Positions command (Command Type: 22) retrieves the positions and bounding rectangles of DOM elements identified by a CSS selector.

Command Type

Command Type ID: 22

Parameters

ParameterTypeDescriptionRequired
selectorstringCSS selector for the target elementsYes
timeoutnumberTimeout in millisecondsYes
filtersFiltersOptional filters to refine element selectionNo

Filters Object

FieldTypeDescription
classNamestringFilter by class name
includeInnerTextArray of stringInclude elements whose inner text contains these strings
excludeInnerTextArray of stringExclude elements whose inner text contains these strings

Usage Examples

Get Button Positions

{
  "command": "get-elements-positions",
  "params": {
    "selector": "button.action",
    "timeout": 10000
  }
}

Get Filtered Element Positions

{
  "command": "get-elements-positions",
  "params": {
    "selector": ".list-item",
    "timeout": 10000,
    "filters": { "includeInnerText": ["Live"] }
  }
}