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]: Sometimes the function page. Waitforxpath() does not detect the DOM that already exists #9682

Closed
2 tasks
FishBlanche opened this issue Feb 15, 2023 · 12 comments
Labels
bug disable-analyzer Disables the automatic workflow that tries to reproduce bug reports needs-feedback unconfirmed

Comments

@FishBlanche
Copy link

Bug expectation

Sometimes the function page. Waitforxpath() does not detect the DOM that already exists
#4072
I have the problem in the latest puppeteer version 19.6.3.

Bug behavior

  • Flaky
  • PDF

Minimal, reproducible example

our own demo..

Error string

TimeoutError: Waiting for selector .//div[@style='visibility: visible;']//*[contains(@class,'tui-dropdown')]//*[text()='全局替换'] failed: Waiting failed: 3000ms exceeded

Puppeteer configuration

No response

Puppeteer version

19.6.3

Node version

16.19.0

Package manager

yarn

Package manager version

1.22.19

Operating system

Windows

@github-actions
Copy link

This issue has an outdated Puppeteer version: 19.6.3. Please verify your issue on the latest 19.7.0 version. Then update the form accordingly.

@FishBlanche
Copy link
Author

This problem does not exist in version 5.4.1(which i currently use).
But because this problem https://bugs.chromium.org/p/chromium/issues/detail?id=1412653#makechanges,
i need to use latest chromium.
Is there any possibility that without upgrading puppeteer but using the latest chromium?

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 16, 2023

Please provide a minimal reproducing example demonstrating the bug: a sample test page and a sample puppeteer script. Otherwise, we cannot help you with this.

@OrKoN OrKoN added needs-feedback disable-analyzer Disables the automatic workflow that tries to reproduce bug reports and removed invalid labels Feb 16, 2023
@FishBlanche
Copy link
Author

Could it be possible that i demonstrate it in my computer?
If it's possible,when will u be available?

@FishBlanche
Copy link
Author

I wonder what's the differences between run browser in top view and not run browser in top view?
My case succeeds when i watch it runs but failed when i don't watch it run....quite strange.
This video recorded that after i launched the test,I just leave the browser backend.The case failed because :
const elXpath = await this.pageDriver.page.waitForXPath(selectorOrTimeout, options);
waitfor_failed

not_observe_browser.mp4

This video recorded that after i launched the test,I watched it run.The case succeeds.
https://user-images.githubusercontent.com/19261291/219544517-bda2b47a-cb2f-4378-8143-eaa232968b23.mp4

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 17, 2023

the browser in headful mode can do all sorts of optimizations if the window is closed and tab is no active. Could you try if it works in headless? Also, try calling page.bringToFront() before doing actions on the page.

@OrKoN
Copy link
Collaborator

OrKoN commented Feb 17, 2023

Can you try/catch the timeout error and print out the web page DOM structure to see if the element is actually there?

@FishBlanche
Copy link
Author

It works ok in headless mode.
Also it works in headful mode in version 5.4.1(which i currently use).
But in higher version (19.6.3),it has problem

@stale
Copy link

stale bot commented Apr 21, 2023

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Apr 21, 2023
@MaciekLeks
Copy link

This error is not a rare thing using proxy:

        TimeoutError: waiting for XPath `//h2[text()[contains(.,'Podsumowanie')]] | //h1[. ='Podsumowanie'] | //div[@class[contains(.,'oneContent active')]]//h1/*[text()='Podsumowanie'] | //h2/span[text()='Podsumowanie'] | //*[@data-tab and @title='Podsumowanie'] | //c-lwc-fns-consumption-summary-wrapper//*[text()='Podsumowanie']` failed: timeout 30000ms exceeded
            at new WaitTask (/pickle/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:636:34)
            at DOMWorld.waitForXPath (/pickle/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:547:26)
            at Frame.waitForXPath (/pickle/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:1005:51)
            at Page.waitForXPath (/pickle/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2272:33)
            at getElement (/pickle/features/support/actions.js:18:26)
            at World.seeElement (/pickle/features/support/actions.js:344:9)
            at World.<anonymous> (/pickle/features/step-definitions/generic.js:117:20)

The error comes from cucumber and it devastes our tests :(

@stale stale bot removed the unconfirmed label May 21, 2023
@stale
Copy link

stale bot commented Jul 20, 2023

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jul 20, 2023
@stale
Copy link

stale bot commented Aug 21, 2023

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accommodate it!

@stale stale bot closed this as completed Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug disable-analyzer Disables the automatic workflow that tries to reproduce bug reports needs-feedback unconfirmed
Projects
None yet
Development

No branches or pull requests

3 participants