Skip to content

[Feature]: locators in iframes not getting highlighted in Chromium or any browser聽#33146

Description

@qk5

馃殌 Feature Request

I would like to see locators within multiple iframes getting highlighted in Chromium or any browser, so I can troubleshoot my iframe locators easily from Visual Studio Code.

Currently, the following default playwrights locators are highlighted in Chromium.

page.getByText('foo');
page.getByRole('button', { name: 'foo' });
etc...

For locator within one iframe, sometimes I see them getting highlighted in Chromium, sometimes not.

page.frameLocator('iframe').getByText('foo');

And for locators within two or more iframes, I have never seen them getting highlighted in Chromium.

page.frameLocator('iframe1').frameLocator('iframe2').getByText('foo');
page.frameLocator('iframe1').frameLocator('iframe2').frameLocator('iframe3').getByText('foo');

In order for me to troubleshoot these iframe locators, I have to use playwright's highlight method, but I need to run my test every time when I work on a new locator.

let fooLocator = page.frameLocator('iframe1').frameLocator('iframe2').getByText('foo');
await fooLocator .highlight();

With that said, if I can see these locators from Chromium without running my test every time for a new locator, it will greatly increase my efficiency.

Example

No response

Motivation

This will help troubleshoot iframe locators much faster.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions