diff --git a/docs/src/debug.md b/docs/src/debug.md index 24b1fcb0f3..cbe77a1dfc 100644 --- a/docs/src/debug.md +++ b/docs/src/debug.md @@ -166,6 +166,7 @@ When running in Debug Mode with `PWDEBUG=console`, a `playwright` object is avai * `playwright.$$(selector)`: Highlight all occurrences of the selector. This reflects how `page.$$` would see the page. * `playwright.inspect(selector)`: Inspect the selector in the Elements panel. + * `playwright.locator(selector)`: Highlight the first occurrence of the locator. * `playwright.clear()`: Clear existing highlights. * `playwright.selector(element)`: Generate a selector that points to the element. diff --git a/docs/src/inspector.md b/docs/src/inspector.md index 3c8e4cceaf..a76f4b52f3 100644 --- a/docs/src/inspector.md +++ b/docs/src/inspector.md @@ -183,6 +183,18 @@ Reveal element in the Elements panel (if DevTools of the respective browser supp > playwright.inspect('text=Log in') ``` +#### playwright.locator(selector) + +Query Playwright element using the actual Playwright query engine, for example: + +```js +> playwright.locator('.auth-form').withText('Log in'); + +> Locator () +> - element: button +> - elements: [button] +``` + #### playwright.selector(element) Generates selector for the given element.