--- id: selectors title: "Selectors" --- Selectors are strings that are used to create [Locator]s. Locators are used to perform actions on the elements by means of methods such as [`method: Locator.click`], [`method: Locator.fill`] and alike. For debugging selectors, see [here](./debug-selectors). Writing good selectors is part art, part science so be sure to checkout the [Best Practices](#best-practices) section. ## Quick guide - Text selector ```js await page.locator('text=Log in').click(); ``` ```java page.locator("text=Log in").click(); ``` ```python async await page.locator("text=Log in").click() ``` ```python sync page.locator("text=Log in").click() ``` ```csharp await page.Locator("text=Log in").ClickAsync(); ``` Learn more about [text selector][text]. - CSS selector ```js await page.locator('button').click(); await page.locator('#nav-bar .contact-us-item').click(); ``` ```java page.locator("button").click(); page.locator("#nav-bar .contact-us-item").click(); ``` ```python async await page.locator("button").click() await page.locator("#nav-bar .contact-us-item").click() ``` ```python sync page.locator("button").click() page.locator("#nav-bar .contact-us-item").click() ``` ```csharp await page.Locator("button").ClickAsync(); await page.Locator("#nav-bar .contact-us-item").ClickAsync(); ``` Learn more about [css selector][css]. - Select by attribute, with css selector ```js await page.locator('[data-test=login-button]').click(); await page.locator('[aria-label="Sign in"]').click(); ``` ```java page.locator("[data-test=login-button]").click(); page.locator("[aria-label='Sign in']").click(); ``` ```python async await page.locator("[data-test=login-button]").click() await page.locator("[aria-label='Sign in']").click() ``` ```python sync page.locator("[data-test=login-button]").click() page.locator("[aria-label='Sign in']").click() ``` ```csharp await page.Locator("[data-test=login-button]").ClickAsync(); await page.Locator("[aria-label='Sign in']").ClickAsync(); ``` Learn more about [css selector][css]. - Combine css and text selectors ```js await page.locator('article:has-text("Playwright")').click(); await page.locator('#nav-bar >> text=Contact Us').click(); ``` ```java page.locator("article:has-text(\"Playwright\")").click(); page.locator("#nav-bar :text(\"Contact us\")").click(); ``` ```python async await page.locator("article:has-text('Playwright')").click() await page.locator("#nav-bar :text('Contact us')").click() ``` ```python sync page.locator("article:has-text('Playwright')").click() page.locator("#nav-bar :text('Contact us')").click() ``` ```csharp await page.Locator("article:has-text(\"Playwright\")").ClickAsync(); await page.Locator("#nav-bar :text(\"Contact us\")").ClickAsync(); ``` Learn more about [`:has-text()` and `:text()` pseudo classes][text]. - Element that contains another, with css selector ```js await page.locator('.item-description:has(.item-promo-banner)').click(); ``` ```java page.locator(".item-description:has(.item-promo-banner)").click(); ``` ```python async await page.locator(".item-description:has(.item-promo-banner)").click() ``` ```python sync page.locator(".item-description:has(.item-promo-banner)").click() ``` ```csharp await page.Locator(".item-description:has(.item-promo-banner)").ClickAsync(); ``` Learn more about [`:has()` pseudo class](#selecting-elements-that-contain-other-elements). - Selecting based on layout, with css selector ```js await page.locator('input:right-of(:text("Username"))').click(); ``` ```java page.locator("input:right-of(:text(\"Username\"))").click(); ``` ```python async await page.locator("input:right-of(:text('Username'))").click() ``` ```python sync page.locator("input:right-of(:text('Username'))").click() ``` ```csharp await page.Locator("input:right-of(:text(\"Username\"))").ClickAsync(); ``` Learn more about [layout selectors](#selecting-elements-based-on-layout). - Only visible elements, with css selector ```js await page.locator('.login-button:visible').click(); ``` ```java page.locator(".login-button:visible").click(); ``` ```python async await page.locator(".login-button:visible").click() ``` ```python sync page.locator(".login-button:visible").click() ``` ```csharp await page.Locator(".login-button:visible").ClickAsync(); ``` Learn more about [selecting visible elements](#selecting-visible-elements). - Pick n-th match ```js await page.locator(':nth-match(:text("Buy"), 3)').click(); ``` ```java page.locator(":nth-match(:text('Buy'), 3)").click(); ``` ```python async await page.locator(":nth-match(:text('Buy'), 3)").click() ``` ```python sync page.locator(":nth-match(:text('Buy'), 3)").click() ``` ```csharp await page.Locator(":nth-match(:text('Buy'), 3)").ClickAsync(); ``` Learn more about [`:nth-match()` pseudo-class](#pick-n-th-match-from-the-query-result). - XPath selector ```js await page.locator('xpath=//button').click(); ``` ```java page.locator("xpath=//button").click(); ``` ```python async await page.locator("xpath=//button").click() ``` ```python sync page.locator("xpath=//button").click() ``` ```csharp await page.Locator("xpath=//button").ClickAsync(); ``` Learn more about [XPath selector][xpath]. - React selector (experimental) ```js await page.locator('_react=ListItem[text *= "milk" i]').click(); ``` ```java page.locator("_react=ListItem[text *= 'milk' i]").click(); ``` ```python async await page.locator("_react=ListItem[text *= 'milk' i]").click() ``` ```python sync page.locator("_react=ListItem[text *= 'milk' i]").click() ``` ```csharp await page.Locator("_react=ListItem[text *= 'milk' i]").ClickAsync(); ``` Learn more about [React selectors][react]. - Vue selector (experimental) ```js await page.locator('_vue=list-item[text *= "milk" i]').click(); ``` ```java page.locator("_vue=list-item[text *= 'milk' i]").click(); ``` ```python async await page.locator("_vue=list-item[text *= 'milk' i]").click() ``` ```python sync page.locator("_vue=list-item[text *= 'milk' i]").click() ``` ```csharp await page.Locator("_vue=list-item[text *= 'milk' i]").ClickAsync(); ``` Learn more about [Vue selectors][vue]. ## Text selector Text selector locates elements that contain passed text. ```js await page.locator('text=Log in').click(); ``` ```java page.locator("text=Log in").click(); ``` ```python async await page.locator("text=Log in").click() ``` ```python sync page.locator("text=Log in").click() ``` ```csharp await page.Locator("text=Log in").ClickAsync(); ``` Text selector has a few variations: - `text=Log in` - default matching is case-insensitive, trims whitespace and searches for a substring. For example, `text=Log` matches ``. ```js await page.locator('text=Log in').click(); ``` ```java page.locator("text=Log in").click(); ``` ```python async await page.locator("text=Log in").click() ``` ```python sync page.locator("text=Log in").click() ``` ```csharp await page.Locator("text=Log in").ClickAsync(); ``` - `text="Log in"` - text body can be escaped with single or double quotes to search for a text node with exact content after trimming whitespace. For example, `text="Log"` does not match `` because ``, because ``. Quoted body follows the usual escaping rules, e.g. use `\"` to escape double quote in a double-quoted string: `text="foo\"bar"`. ```js await page.locator('text="Log in"').click(); ``` ```java page.locator("text='Log in'").click(); ``` ```python async await page.locator("text='Log in'").click() ``` ```python sync page.locator("text='Log in'").click() ``` ```csharp await page.Locator("text='Log in'").ClickAsync(); ``` - `"Log in"` - selector starting and ending with a quote (either `"` or `'`) is assumed to be a text selector. For example, `"Log in"` is converted to `text="Log in"` internally. ```js await page.locator('"Log in"').click(); ``` ```java page.locator("'Log in'").click(); ``` ```python async await page.locator("'Log in'").click() ``` ```python sync page.locator("'Log in'").click() ``` ```csharp await page.Locator("'Log in'").ClickAsync(); ``` - `/Log\s*in/i` - body can be a [JavaScript-like regex](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) wrapped in `/` symbols. For example, `text=/Log\s*in/i` matches `` and ``. ```js await page.locator('text=/Log\\s*in/i').click(); ``` ```java page.locator("text=/Log\\s*in/i").click(); ``` ```python async await page.locator("text=/Log\s*in/i").click() ``` ```python sync page.locator("text=/Log\s*in/i").click() ``` ```csharp await page.Locator("text=/Log\\s*in/i").ClickAsync(); ``` - `article:has-text("Playwright")` - the `:has-text()` pseudo-class can be used inside a [css] selector. It matches any element containing specified text somewhere inside, possibly in a child or a descendant element. Matching is case-insensitive, trims whitestapce and searches for a substring. For example, `article:has-text("Playwright")` matches `
Playwright
`. Note that `:has-text()` should be used together with other `css` specifiers, otherwise it will match all the elements containing specified text, including the ``. ```js // Wrong, will match many elements including await page.locator(':has-text("Playwright")').click(); // Correct, only matches the
element await page.locator('article:has-text("Playwright")').click(); ``` ```java // Wrong, will match many elements including page.locator(":has-text(\"Playwright\")").click(); // Correct, only matches the
element page.locator("article:has-text(\"Playwright\")").click(); ``` ```python async # Wrong, will match many elements including await page.locator(':has-text("Playwright")').click() # Correct, only matches the
element await page.locator('article:has-text("Playwright")').click() ``` ```python sync # Wrong, will match many elements including page.locator(':has-text("Playwright")').click() # Correct, only matches the
element page.locator('article:has-text("All products")').click() ``` ```csharp // Wrong, will match many elements including await page.Locator(":has-text(\"Playwright\")").ClickAsync(); // Correct, only matches the
element await page.Locator("article:has-text(\"Playwright\")").ClickAsync(); ``` - `#nav-bar :text("Home")` - the `:text()` pseudo-class can be used inside a [css] selector. It matches the smallest element containing specified text. This example is equivalent to `text=Home`, but inside the `#nav-bar` element. ```js await page.locator('#nav-bar :text("Home")').click(); ``` ```java page.locator("#nav-bar :text('Home')").click(); ``` ```python async await page.locator("#nav-bar :text('Home')").click() ``` ```python sync page.locator("#nav-bar :text('Home')").click() ``` ```csharp await page.Locator("#nav-bar :text('Home')").ClickAsync(); ``` - `#nav-bar :text-is("Home")` - the `:text-is()` pseudo-class can be used inside a [css] selector, for strict text node match. This example is equivalent to `text="Home"` (note quotes), but inside the `#nav-bar` element. * `#nav-bar :text-matches("reg?ex", "i")` - the `:text-matches()` pseudo-class can be used inside a [css] selector, for regex-based match. This example is equivalent to `text=/reg?ex/i`, but inside the `#nav-bar` element. :::note Matching always normalizes whitespace. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace. ::: :::note Input elements of the type `button` and `submit` are matched by their `value` instead of text content. For example, `text=Log in` matches ``. ::: ## CSS selector Playwright augments standard CSS selectors in two ways: * `css` engine pierces open shadow DOM by default. * Playwright adds custom pseudo-classes like `:visible`, `:text` and more. ```js await page.locator('button').click(); ``` ```java page.locator("button").click(); ``` ```python async await page.locator("button").click() ``` ```python sync page.locator("button").click() ``` ```csharp await page.Locator("button").ClickAsync(); ``` ## Selecting visible elements There are two ways of selecting only [visible](./actionability.md#visible) elements with Playwright: - `:visible` pseudo-class in CSS selectors - `visible=` selector engine If you prefer your selectors to be CSS and don't want to rely on [chaining selectors](#chaining-selectors), use `:visible` pseudo class like so: `input:visible`. If you prefer combining selector engines, use `input >> visible=true`. The latter allows you to combine `text=`, `xpath=` and other selector engines with the visibility filter. For example, `input` matches all the inputs on the page, while `input:visible` and `input >> visible=true` only match visible inputs. This is useful to distinguish elements that are very similar but differ in visibility. :::note It's usually better to follow the [best practices](#best-practices) and find a more reliable way to uniquely identify the element. ::: Consider a page with two buttons, first invisible and second visible. ```html ``` * This will find the first button because it is the first element in DOM order. Then it will wait for the button to become visible before clicking, or timeout while waiting: ```js await page.locator('button').click(); ``` ```java page.locator("button").click(); ``` ```python async await page.locator("button").click() ``` ```python sync page.locator("button").click() ``` ```csharp await page.Locator("button").ClickAsync(); ``` * These will find a second button, because it is visible, and then click it. ```js await page.locator('button:visible').click(); await page.locator('button >> visible=true').click(); ``` ```java page.locator("button:visible").click(); page.locator("button >> visible=true").click(); ``` ```python async await page.locator("button:visible").click() await page.locator("button >> visible=true").click() ``` ```python sync page.locator("button:visible").click() page.locator("button >> visible=true").click() ``` ```csharp await page.Locator("button:visible").ClickAsync(); await page.Locator("button >> visible=true").ClickAsync(); ``` ## Selecting elements that contain other elements ### Filter by text Locators support an option to only select elements that have some text somewhere inside, possibly in a descendant element. Matching is case-insensitive and searches for a substring. ```js await page.locator('button', { hasText: 'Click me' }).click(); ``` ```java page.locator("button", new Page.LocatorOptions().setHasText("Click me")).click(); ``` ```python async await page.locator("button", has_text="Click me").click() ``` ```python sync page.locator("button", has_text="Click me").click() ``` ```csharp await page.Locator("button", new() { HasText = "Click me" }).ClickAsync(); ``` You can also pass a regular expression. ### Filter by another locator Locators support an option to only select elements that have a descendant matching another locator. ```js page.locator('article', { has: page.locator('button.subscribe') }) ``` ```java page.locator("article", new Page.LocatorOptions().setHas(page.locator("button.subscribe"))) ``` ```python async page.locator("article", has=page.locator("button.subscribe")) ``` ```python sync page.locator("article", has=page.locator("button.subscribe")) ``` ```csharp page.Locator("article", new() { Has = page.Locator("button.subscribe") }) ``` Note that inner locator is matched starting from the outer one, not from the document root. ### Inside CSS selector The `:has()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the :scope of the given element match at least one element. Following snippet returns text content of an `
` element that has a `
` inside. ```js await page.locator('article:has(div.promo)').textContent(); ``` ```java page.locator("article:has(div.promo)").textContent(); ``` ```python async await page.locator("article:has(div.promo)").text_content() ``` ```python sync page.locator("article:has(div.promo)").text_content() ``` ```csharp await page.Locator("article:has(div.promo)").TextContentAsync(); ``` ## Augmenting existing locators You can add filtering to any locator by passing `:scope` selector to [`method: Locator.locator`] and specifying desired options. For example, given the locator `row` that selects some rows in the table, you can filter to just those that contain text "Hello". ```js const row = page.locator('.row'); // ... later on ... await row.locator(':scope', { hasText: 'Hello' }).click(); ``` ```java Locator row = page.locator(".row"); // ... later on ... row.locator(":scope", new Locator.LocatorOptions().setHasText("Hello")).click(); ``` ```python async row = page.locator(".row") # ... later on ... await row.locator(":scope", has_text="Hello").click() ``` ```python sync row = page.locator(".row") # ... later on ... row.locator(":scope", has_text="Hello").click() ``` ```csharp var locator = page.Locator(".row"); // ... later on ... await locator.Locator(":scope", new() { HasText = "Hello" }).ClickAsync(); ``` ## Selecting elements matching one of the conditions ### CSS selector list Comma-separated list of CSS selectors will match all elements that can be selected by one of the selectors in that list. ```js // Clicks a
``` In this case, `:nth-match(:text("Buy"), 3)` will select the third button from the snippet above. Note that index is one-based. ```js // Click the third "Buy" button await page.locator(':nth-match(:text("Buy"), 3)').click(); ``` ```java // Click the third "Buy" button page.locator(":nth-match(:text('Buy'), 3)").click(); ``` ```python async # Click the third "Buy" button await page.locator(":nth-match(:text('Buy'), 3)").click() ``` ```python sync # Click the third "Buy" button page.locator(":nth-match(:text('Buy'), 3)").click() ``` ```csharp // Click the third "Buy" button await page.Locator(":nth-match(:text('Buy'), 3)").ClickAsync(); ``` `:nth-match()` is also useful to wait until a specified number of elements appear, using [`method: Locator.waitFor`]. ```js // Wait until all three buttons are visible await page.locator(':nth-match(:text("Buy"), 3)').waitFor(); ``` ```java // Wait until all three buttons are visible page.locator(":nth-match(:text('Buy'), 3)").waitFor(); ``` ```python async # Wait until all three buttons are visible await page.locator(":nth-match(:text('Buy'), 3)").wait_for() ``` ```python sync # Wait until all three buttons are visible page.locator(":nth-match(:text('Buy'), 3)").wait_for() ``` ```csharp // Wait until all three buttons are visible await page.Locator(":nth-match(:text('Buy'), 3)").WaitForAsync(); ``` :::note Unlike [`:nth-child()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child), elements do not have to be siblings, they could be anywhere on the page. In the snippet above, all three buttons match `:text("Buy")` selector, and `:nth-match()` selects the third button. ::: :::note It is usually possible to distinguish elements by some attribute or text content. In this case, prefer using [text] or [css] selectors over the `:nth-match()`. ::: ## Parent selector The parent could be selected with `..`, which is a short form for `xpath=..`. For example: ```js const parentLocator = elementLocator.locator('..'); ``` ```java Locator parentLocator = elementLocator.locator(".."); ``` ```python async parent_locator = element_locator.locator('..') ``` ```python sync parent_locator = element_locator.locator('..') ``` ```csharp var parentLocator = elementLocator.Locator(".."); ``` ## Chaining selectors Selectors defined as `engine=body` or in short-form can be combined with the `>>` token, e.g. `selector1 >> selector2 >> selectors3`. When selectors are chained, the next one is queried relative to the previous one's result. For example, ``` css=article >> css=.bar > .baz >> css=span[attr=value] ``` is equivalent to ```js browser document .querySelector('article') .querySelector('.bar > .baz') .querySelector('span[attr=value]') ``` If a selector needs to include `>>` in the body, it should be escaped inside a string to not be confused with chaining separator, e.g. `text="some >> text"`. ### Intermediate matches By default, chained selectors resolve to an element queried by the last selector. A selector can be prefixed with `*` to capture elements that are queried by an intermediate selector. For example, `css=article >> text=Hello` captures the element with the text `Hello`, and `*css=article >> text=Hello` (note the `*`) captures the `article` element that contains some element with the text `Hello`. ## Best practices The choice of selectors determines the resiliency of automation scripts. To reduce the maintenance burden, we recommend prioritizing user-facing attributes and explicit contracts. ### Prioritize user-facing attributes Attributes like text content, input placeholder, accessibility roles and labels are user-facing attributes that change rarely. These attributes are not impacted by DOM structure changes. The following examples use the built-in [text] and [css] selector engines. ```js // queries "Login" text selector await page.locator('text="Login"').click(); await page.locator('"Login"').click(); // short-form // queries "Search GitHub" placeholder attribute await page.locator('css=[placeholder="Search GitHub"]').fill('query'); await page.locator('[placeholder="Search GitHub"]').fill('query'); // short-form // queries "Close" accessibility label await page.locator('css=[aria-label="Close"]').click(); await page.locator('[aria-label="Close"]').click(); // short-form // combine role and text queries await page.locator('css=nav >> text=Login').click(); ``` ```java // queries "Login" text selector page.locator("text=\"Login\"").click(); page.locator("\"Login\"").click(); // short-form // queries "Search GitHub" placeholder attribute page.locator("css=[placeholder='Search GitHub']").fill("query"); page.locator("[placeholder='Search GitHub']").fill("query"); // short-form // queries "Close" accessibility label page.locator("css=[aria-label='Close']").click(); page.locator("[aria-label='Close']").click(); // short-form // combine role and text queries page.locator("css=nav >> text=Login").click(); ``` ```python async # queries "Login" text selector await page.locator('text="Login"').click() await page.locator('"Login"').click() # short-form # queries "Search GitHub" placeholder attribute await page.locator('css=[placeholder="Search GitHub"]').fill('query') await page.locator('[placeholder="Search GitHub"]').fill('query') # short-form # queries "Close" accessibility label await page.locator('css=[aria-label="Close"]').click() await page.locator('[aria-label="Close"]').click() # short-form # combine role and text queries await page.locator('css=nav >> text=Login').click() ``` ```python sync # queries "Login" text selector page.locator('text="Login"').click() page.locator('"Login"').click() # short-form # queries "Search GitHub" placeholder attribute page.locator('css=[placeholder="Search GitHub"]').fill('query') page.locator('[placeholder="Search GitHub"]').fill('query') # short-form # queries "Close" accessibility label page.locator('css=[aria-label="Close"]').click() page.locator('[aria-label="Close"]').click() # short-form # combine role and text queries page.locator('css=nav >> text=Login').click() ``` ```csharp // queries "Login" text selector await page.Locator("text=\"Login\"").ClickAsync(); await page.Locator("\"Login\"").ClickAsync(); // short-form // queries "Search GitHub" placeholder attribute await page.Locator("css=[placeholder='Search GitHub']").FillAsync("query"); await page.Locator("[placeholder='Search GitHub']").FillAsync("query"); // short-form // queries "Close" accessibility label await page.Locator("css=[aria-label='Close']").ClickAsync(); await page.Locator("[aria-label='Close']").ClickAsync(); // short-form // combine role and text queries await page.Locator("css=nav >> text=Login").ClickAsync(); ``` ### Define explicit contract When user-facing attributes change frequently, it is recommended to use explicit test ids, like `data-test-id`. These `data-*` attributes are supported by the [css] and [id selectors][id]. ```html ``` ```js // queries data-test-id attribute with css await page.locator('css=[data-test-id=directions]').click(); await page.locator('[data-test-id=directions]').click(); // short-form // queries data-test-id with id await page.locator('data-test-id=directions').click(); ``` ```java // queries data-test-id attribute with css page.locator("css=[data-test-id=directions]").click(); page.locator("[data-test-id=directions]").click(); // short-form // queries data-test-id with id page.locator("data-test-id=directions").click(); ``` ```python async # queries data-test-id attribute with css await page.locator('css=[data-test-id=directions]').click() await page.locator('[data-test-id=directions]').click() # short-form # queries data-test-id with id await page.locator('data-test-id=directions').click() ``` ```python sync # queries data-test-id attribute with css page.locator('css=[data-test-id=directions]').click() page.locator('[data-test-id=directions]').click() # short-form # queries data-test-id with id page.locator('data-test-id=directions').click() ``` ```csharp // queries data-test-id attribute with css await page.Locator("css=[data-test-id=directions]").ClickAsync(); await page.Locator("[data-test-id=directions]").ClickAsync(); // short-form // queries data-test-id with id await page.Locator("data-test-id=directions").ClickAsync(); ``` ### Avoid selectors tied to implementation [xpath] and [css] can be tied to the DOM structure or implementation. These selectors can break when the DOM structure changes. Similarly, [`method: Locator.nth`], [`method: Locator.first`], and [`method: Locator.last`] are tied to implementation and the structure of the DOM, and will target the incorrect element if the DOM changes. ```js // avoid long css or xpath chains await page.locator('#tsf > div:nth-child(2) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input').click(); await page.locator('//*[@id="tsf"]/div[2]/div[1]/div[1]/div/div[2]/input').click(); ``` ```java // avoid long css or xpath chains page.locator("#tsf > div:nth-child(2) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").click(); page.locator("//*[@id='tsf']/div[2]/div[1]/div[1]/div/div[2]/input").click(); ``` ```python async # avoid long css or xpath chains await page.locator('#tsf > div:nth-child(2) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input').click() await page.locator('//*[@id="tsf"]/div[2]/div[1]/div[1]/div/div[2]/input').click() ``` ```python sync # avoid long css or xpath chains page.locator('#tsf > div:nth-child(2) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input').click() page.locator('//*[@id="tsf"]/div[2]/div[1]/div[1]/div/div[2]/input').click() ``` ```csharp // avoid long css or xpath chains await page.Locator("#tsf > div:nth-child(2) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input").ClickAsync(); await page.Locator("//*[@id='tsf']/div[2]/div[1]/div[1]/div/div[2]/input").ClickAsync(); ``` [text]: #text-selector [css]: #css-selector [xpath]: #xpath-selectors [react]: #react-selectors [vue]: #vue-selectors [id]: #id-data-testid-data-test-id-data-test-selectors