🚀 Feature Request
Enable highlighting of elements in browser when hovering over nested locators
Example
import { test } from "@playwright/test";
test("test", async ({ page }) => {
await page.goto("https://playwright.dev");
const heroBanner = page.locator(".hero");
const getStartedButton = page.getByRole("link", { name: "Get Started" }); // element is highlighted when hovering over this line
const getStartedButton_nested = heroBanner.getByRole("link", { name: "Get Started" }); // element is not highlighted when hovering over this line
});
getStartedButton

getStartedButton_nested

Motivation
Implementing element highlighting for nested locators on hover will greatly enhance the accuracy and efficiency of UI inspection, especially for complex layouts. This feature will streamline debugging and provide immediate visual feedback on nested elements, improving the overall development workflow.