Skip to content

[Feature]: Enable highlighting of elements in browser when hovering over nested locators #33323

@JanLechvar

Description

@JanLechvar

🚀 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
Image

getStartedButton_nested
Image

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions