Skip to content

[BUG] page.waitForSelector() and waitFor: 'attached' not working properly #2026

Closed

Description

Context:

  • Playwright Version: 0.15.0
  • Operating System: Ubuntu 18.04.4
  • Node version: v12.15.0
  • Browser: Chromium

Code Snippet

// always works
await page.waitForSelector('lib-table-widget v0-icon', {
  waitFor: 'visible',
});
// never works
await page.waitForSelector('lib-table-widget v0-icon');

Here is the JSPath to the selector:

document.querySelector("body > container").shadowRoot.querySelector("#container > container-layout-holder").shadowRoot.querySelector("#LayoutHolder-app-content > app-content").shadowRoot.querySelector("#AppContent-inner > alarm-viewer").shadowRoot.querySelector("div > lib-dashboard").shadowRoot.querySelector("div > lib-tablwidget > div:nth-child(2) > lib-table").shadowRoot.querySelector("div:nth-child(3) > internal-extended-table").shadowRoot.querySelector("div > table > tbody > tr > td:nth-child(2) > span > span > v0-icon")

Describe the bug

I have no idea, but lately I've been noticing a lot of flakiness with waitForSelector() with its default for waitFor. As in the above case, as the default is waitFor: 'attached', attached surely needs to happen for visible to occur. Still the default does not work. It times out waiting for the element.

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