Selectors in DogQ

DogQ supports XPath and CSS selectors. Both are powerful and oftentimes interchangeable but also do have their unique use cases. You can also find elements by simply using their label (text).

Label (text)

This way you can locate elements that contain label value or a specific text within it.

For instance, you can use a button name to click on this button later.

CSS Selector

You can also construct locators using CSS syntax, e.g. ".btn-next", "[href="/login"]", etc.

To create a selector by attribute, contain the attribute name and its value in square brackets [ ].

To create a selector by class, simply list the classes, preceeding each individual class with a dot .

To create a selector by ID, preface the value with a hash symbol #.

XPath

There are many ways to use XPath. Its syntax and built-in functions allow for dynamic and robust locators. Please, check out our Beginner's Guide to XPath.

Last updated