Selectors in DogQ
Last updated
Was this helpful?
Last updated
Was this helpful?
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).
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.
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 #.
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.