> For the complete documentation index, see [llms.txt](https://docs.dogq.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dogq.io/documentation/selectors/selectors-in-dogq.md).

# 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.

<figure><img src="/files/cTPba9vySVa5tVWj2G6m" alt=""><figcaption></figcaption></figure>

### **CSS Selector**

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

To create a selector **by attribute**, contain the attribute name and its value in square brackets **\[ ]**.&#x20;

<figure><img src="/files/PIegGHj82EIl4jOWaodR" alt=""><figcaption></figcaption></figure>

To create a selector **by class**, simply list the classes, preceeding each individual class with a dot **.**&#x20;

<figure><img src="/files/267ECmjXFYW4tecYDlhe" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/Pra9s09BMRmTXZAQJIdW" alt=""><figcaption></figcaption></figure>

### **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](https://docs.dogq.io/documentation/selectors/beginners-guide-to-xpath). &#x20;

<figure><img src="/files/tbjJhSCRWoF5pGSzdEg3" alt=""><figcaption></figcaption></figure>
