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.
2 ATS Selectors
The custom ATS selectors work the same as CSS3 selectors in your custom actions:
|:clickable||Clickable pseudo-class||Selects a user interface element whose CSS visibility property is set to visible.|
|:containsExact(text)||ContainsExact pseudo-class||Selects a element whose inner HTML is exactly equal to the given text (not case sensitive).|
|:containsExactCase(text)||ContainsExactCase pseudo-class||Selects a element whose inner HTML is exactly equal to the given text (case sensitive).|
|:containsRegex(regex)||ContainsRegex pseudo-class||Selects a element whose inner HTML matches the given regex.|
|:containsText(text)||ContainsText pseudo-class||Selects a 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-class||Selects an input, select, or text area whose value is equal to the given text.|
3 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:
|.myClass||Class Selector||Selects every element with the class
|#myID||ID Selector||Selects every element with the ID
|E[foo=“bar”]||Attribute Selector||Selects every element
|:nth-child(n)||Nth-child pseudo-class||Selects the
|:first-child||First-Child pseudo-class||Selects the first child of its parent.|
|:last-child||Last-Child pseudo-class||Selects the lastchild of its parent.|
|:checked||Checked pseudo-class||Selects a user interface element which is checked.|
|E > F||Child Combinator||Selects an
For more information, see W3C CSS3 Selectors Reference.
4 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
$(...) function. Only use simple selectors, without quotations.
$(...) function to select a WebElement or node.
The following table shows a few selectors from the JQuery set that you can use in ATS:
|:animated||Animated Selector||Selects all the elements that are in the progress of an animation at the time the selector is run.|
|:checkbox||Checkbox Selector||Selects all the elements of the check box type.|
|:input||Input Selector||Selects all the inputs, text area, select, and button elements.|
|:has(selector)||Has Selector||Selects elements that contain at least one element that matches the specified selector.|
|:parent||Parent Selector||Select all the elements that have at least one child node (either an element or text).|
|:text||Text Selector||Selects all the input elements of the type text.|
For more information, see JQuery Selectors Reference.