Skip to main content

find

Check if an element exists with the specified CSS selector.

Fields

FieldTypeDescriptionDefault
idstringOptional. ID of the step.Generated UUID
descriptionstringOptional. Description of the step.
actionstringRequired. Action to perform.
selectorstringRequired. Selector that uniquely identifies the element.
timeoutintegerOptional. Max duration in milliseconds to wait for the element to exist.5000
matchTextstringOptional. Text that the element should contain. If the element doesn't contain the text, the step fails. Accepts both strings an regular expressions. To use a regular expression, the expression should start and end with a /. For example, /search/.
moveTo[object Object]Optional. Move to the element. If the element isn't visible, it's scrolled into view. Only runs the if the test is being recorded.false
clickbooleanOptional. Click the element.false
typeKeysOne of
- string
- object
Optional. Type keys after finding the element. Either a string or an object with a keys field as defined in typeKeys. To type in the element, make the element active with the click parameter.
setVariablesarray of objectsOptional. Extract environment variables from the element's text.[]
setVariables.namestringRequired. Name of the environment variable to set.
setVariables.regexstringRequired. Regex to extract the environment variable from the element's text.

Examples

{
"action": "find",
"selector": "[title=Search]"
}
{
"action": "find",
"selector": "[title=Search]",
"timeout": 10000,
"matchText": "Search",
"moveTo": true,
"click": true,
"typeKeys": "shorthair cat"
}
{
"action": "find",
"selector": "[title=Search]",
"timeout": 10000,
"matchText": "Search",
"moveTo": true,
"click": true,
"typeKeys": {
"keys": [
"shorthair cat"
],
"delay": 100
}
}
{
"action": "find",
"selector": "[title=ResultsCount]",
"setVariables": [
{
"name": "resultsCount",
"regex": ".*"
}
]
}