Skip to content

[Question] Can't wait for an element to be visible when it is overlapped with other elements in frontend #6240

Closed

Description

Hi Experts,

I have a doubt here.
This is frontend. As you can see, here is one line with zero value. So the whole line is overlapped with the zero value.
image

HTML is as below:
image

Code:

const selector = `${this.selector} svg g[class="line-group"] path`;
await page.waitForSelector(selector);
const pathElements = await page.$$(`${selector} path`);
return pathElements.length;

When I run this code in debug mode, it will stuck in the "waitForSelector", it seems that playwright don't find the element, but I do see it display in the frontend. However, if I change the code to be "page.waitForSelector(selector, {state: "attached"}", it can work well.

Therefore, I want to know why it can't find the selector to be visible?

Thanks

BR,
Wenshu

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions