question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] page.pause() does not stop

See original GitHub issue

Context:

  • Playwright Version: 1.20.1
  • Operating System: Win 10 pro
  • Node.js version: 16.13.1
  • Browser: Chromium

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 this.page.pause()

Describe the bug

page.pause() stopped stopping and just steps forward, so no way to access the inspector and the recorder. No option changed, and been like this v18 I think. Is there an option to disable the pause() call?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
DetachHeadcommented, Apr 12, 2022

using debugger doesn’t really replace page.pause because it’s effectively the exact same as a breakpoint. i use page.pause when i want to pause the execution without halting the event loop (ie. to work around issues like #10897 and #11668).

another use case is:

await page.route('**/foo*', async (route) => {
    const request = route.request()
    doSomethingWith(request) //BREAKPOINT HERE
})
await page.goto('https://google.com')
await page.waitForLoadState('networkidle')
await page.pause()

here, i want to pause execution once the site loads so i can manually poke around and hit the brekpoint in page.route once a matching request is intercepted. if i replace that await page.pause() with a debugger statement, i can’t do anything because navigation hangs until the event loop resumes

now i have to resort to something like await page.waitForTimeout(9999999) which isn’t ideal

1reaction
andrisicommented, Apr 20, 2022

I agree. It’s useful functionality, and not clear why remove it. You can name it something else, make it work when a flag is set, etc. Playwright is an excellent project from Microsoft, along with Vscode, but this feels like Windows 11 dropping the vertical talkbar. Some people like it that way… 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Playwright Inspector and page.pause() (#214) - YouTube
Specifically, we take a look at how ` pause ()` and Playwright Inspector can help you to understand what's happening in your tests...
Read more >
Page - Playwright
If runBeforeUnload is true the method will run unload handlers, but will not wait for the page to close. By default, page.close() does...
Read more >
Paused in debugger in chrome? - Stack Overflow
One possible cause, it that you've enabled the "pause on exceptions" (the little stop-sign shaped icon with the pause (||) symbol within in...
Read more >
1288620 - Media pauses unexpectedly without user input
I am using Chrome on Ubuntu 20.04.3, but the problem has been ... The debug log also didn't produce anything when playback stopped....
Read more >
Troubleshooting | Apps Script - Google Developers
Since this is not a valid email address the following error is thrown ... a script is run from a trigger, embedded with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found