# class: Locator * since: v1.14 Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. Locator can be created with the [`method: Page.locator`] method. [Learn more about locators](../locators.md). ## async method: Locator.allInnerTexts * since: v1.14 - returns: <[Array]<[string]>> Returns an array of `node.innerText` values for all matching nodes. ## async method: Locator.allTextContents * since: v1.14 - returns: <[Array]<[string]>> Returns an array of `node.textContent` values for all matching nodes. ## async method: Locator.blur * since: v1.28 Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur) on the element. ### option: Locator.blur.timeout = %%-input-timeout-%% * since: v1.28 ## async method: Locator.boundingBox * since: v1.14 - returns: <[null]|[Object]> - `x` <[float]> the x coordinate of the element in pixels. - `y` <[float]> the y coordinate of the element in pixels. - `width` <[float]> the width of the element in pixels. - `height` <[float]> the height of the element in pixels. This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is calculated relative to the main frame viewport - which is usually the same as the browser window. Scrolling affects the returned bounding box, similarly to [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That means `x` and/or `y` may be negative. Elements from child frames return the bounding box relative to the main frame, unlike the [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following snippet should click the center of the element. ```js const box = await element.boundingBox(); await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2); ``` ```java BoundingBox box = element.boundingBox(); page.mouse().click(box.x + box.width / 2, box.y + box.height / 2); ``` ```python async box = await element.bounding_box() await page.mouse.click(box["x"] + box["width"] / 2, box["y"] + box["height"] / 2) ``` ```python sync box = element.bounding_box() page.mouse.click(box["x"] + box["width"] / 2, box["y"] + box["height"] / 2) ``` ```csharp var box = await element.BoundingBoxAsync(); await page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2); ``` ### option: Locator.boundingBox.timeout = %%-input-timeout-%% * since: v1.14 ## async method: Locator.check * since: v1.14 This method checks the element by performing the following steps: 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already checked, this method returns immediately. 1. Wait for [actionability](../actionability.md) checks on the element, unless [`option: force`] option is set. 1. Scroll the element into view if needed. 1. Use [`property: Page.mouse`] to click in the center of the element. 1. Wait for initiated navigations to either succeed or fail, unless [`option: noWaitAfter`] option is set. 1. Ensure that the element is now checked. If not, this method throws. If the element is detached from the DOM at any moment during the action, this method throws. When all steps combined have not finished during the specified [`option: timeout`], this method throws a [TimeoutError]. Passing zero timeout disables this. ### option: Locator.check.position = %%-input-position-%% * since: v1.14 ### option: Locator.check.force = %%-input-force-%% * since: v1.14 ### option: Locator.check.noWaitAfter = %%-input-no-wait-after-%% * since: v1.14 ### option: Locator.check.timeout = %%-input-timeout-%% * since: v1.14 ### option: Locator.check.trial = %%-input-trial-%% * since: v1.14 ## async method: Locator.clear * since: v1.28 This method waits for [actionability](../actionability.md) checks, focuses the element, clears it and triggers an `input` event after clearing. If the target element is not an ``, `