Selectors

Last modified: June 18, 2025

Introduction

For the Find Widget Child Node action or as part of a script for the Execute JavaScript Integer, Execute JavaScript String, and Execute JavaScript WebElement actions, you must use selectors to get a node or WebElement.

ATS supports both JQuery and CSS3 selectors. ATS also has its own selectors. The following summary will give you a short overview of the most used selectors in ATS.

ATS Selectors

The custom ATS selectors work the same as CSS3 selectors in your custom actions:

PatternNameMeaning
:clickableClickable pseudo-classSelects a user interface element whose CSS visibility property is set to visible.
:containsExact(text)ContainsExact pseudo-classSelects an element whose inner HTML is exactly equal to the given text (not case sensitive).
:containsExactCase(text)ContainsExactCase pseudo-classSelects an element whose inner HTML is exactly equal to the given text (case sensitive).
:containsRegex(regex)ContainsRegex pseudo-classSelects an element whose inner HTML matches the given regex.
:containsText(text)ContainsText pseudo-classSelects an element whose inner text value is equal to the given text. Can only be used on text, CDATA, and element nodes.
:val(text)Value pseudo-classSelects an input, select, or text area whose value is equal to the given text.

CSS Selectors

You can use any CSS Selector defined in CSS3 and supported by your browser. The following table shows some of the commonly used CSS3 selectors in ATS:

PatternNameMeaning
.myClassClass SelectorSelects every element with the class myClass.
#myIDID SelectorSelects every element with the ID myID.
E[foo="bar"]Attribute SelectorSelects every element E whose foo attribute value is equal to bar.
:nth-child(n)Nth-child pseudo-classSelects the n-th child of its parent.
:first-childFirst-Child pseudo-classSelects the first child of its parent.
:last-childLast-Child pseudo-classSelects the last child of its parent.
:checkedChecked pseudo-classSelects a user interface element which is checked.
E > FChild CombinatorSelects an F element child of an E element.

For more information, see W3C CSS3 Selectors Reference.

JQuery Selectors

JQuery uses CSS3 selectors and extends the collection of selectors with its own ones. You can use all these selectors in your ATS actions.

If you use JQuery selectors in the Find Widget Child Node action, you must NOT use the jQuery(...) or $(...) function. Only use simple selectors, without quotations.

In the Execute JavaScript action, you must use the jQuery(...) or $(...) function to select a WebElement or node.

The following table shows a few selectors from the JQuery set that you can use in ATS:

PatternNameMeaning
:animatedAnimated SelectorSelects all the elements that are in the progress of an animation at the time the selector is run.
:checkboxCheckbox SelectorSelects all the elements of the checkbox type.
:inputInput SelectorSelects all the inputs, text area, select, and button elements.
:has(selector)Has SelectorSelects elements that contain at least one element that matches the specified selector.
:parentParent SelectorSelect all the elements that have at least one child node (either an element or text).
:textText SelectorSelects all the input elements of the type text.

For more information, see JQuery Selectors Reference.