Rayrun
← Back to Discord Forum

Page closed error when running with multiple workers

I am trying to implement sharding in Jenkins. I have a very simple example (trying to emulate sharding by following example in 1.37 release) But some of the test case fail randomly due to Error: page.textContent: Page closed

wait for locator('div[class='\card body recipe card text secondary']>div>h4').first()

Pending operations: -page.textContent at example.ts .....

I think it might be due to async condition but I am not sure . Could someone please suggest?

image.png

This thread is trying to answer question "Why does the 'Page closed' error occur when running test cases in Jenkins with sharding implemented, and how can it be resolved?"

4 replies

Any pointers?

looks like the element is not there. We strongly discourage from using textContent, use toHaveText instead: https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-text

i've seen same issue - getting text or clicking something kicks page closed error, while page is still there

should looks like the element is not there trigger timeout or stale element ( depends )?

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].