Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Waitforselector fail to read the element in execution but works when debugging. #2527

Closed
vrknetha opened this issue Jun 10, 2020 · 2 comments

Comments

@vrknetha
Copy link

Context:

  • Playwright Version: [1.0.2]
  • Operating System: [Windows]
  • Node version: [12]
  • Browser: [Chromium]
  • Extra: [Jest]
    Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

await page.waitForSelector('[data-target="#addRemoveModal"]');

Describe the bug

The selector works when I put on a breakpoint before executing this step but fails in execution.

<a _ngcontent-blu-c7="" class="btn btn-link" data-target="#addRemoveModal" data-toggle="modal" href="javascript:" xpath="1">Assign/Remove groups </a>

pw:api waiting for scheduled navigations to finish +1ms pw:api navigations have finished +3ms pw:api <= page.click succeeded +6ms pw:api => page.waitForSelector started +2ms pw:api waiting for selector "[data-target="#addRemoveModal"]" to be visible +1ms pw:api <= page.waitForSelector failed +30s

@pavelfeldman
Copy link
Member

pavelfeldman commented Jun 10, 2020

It could be that there is this button on a page, but it is invisible. Then another button matching the same query appears, but we are still waiting on the old one. When you set a breakpoint, you give this old button a chance to disappear, so we never see it / are mislead with it when we wait. Does that sound plausible?

@pavelfeldman
Copy link
Member

Assuming the suggestion above was the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants