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.

[Feature] `screenshot` methods can have a long delay

See original GitHub issue

So basically I have noticed that screenshot functions can have a rather long delay before actually taking the screenshot.

try:
    if not page.locator("#foo").is_visible():
        raise Exception("failed to find element")
except Exception:
    page.screenshot()  # the element appears before it takes the screenshot because 'screenshot' is doing something that takes a long time
    raise

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
KotlinIslandcommented, Oct 27, 2022

Wow, this is blazingly fast🔥! That’s amazing 🚀.

2reactions
DetachHeadcommented, Oct 26, 2022

here’s a workaround to take a screenshot with no delay:

const base64 = (await (await page.context().newCDPSession(page)).send('Page.captureScreenshot')).data

it would be nice if playwright’s screenshot method had an option to behave like this

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the Delay feature in Windows 10's Snipping Tool
Once the Snipping Tool is up and running, click Delay, as shown in Figure B, and select the number of seconds you want...
Read more >
Capture pop-up menus with Windows 10's new delayed ...
First, open up the Snipping tool and click Delay to choose your delay time in seconds. You can choose between 0 and 5...
Read more >
How do I take screenshots with a delay? - Ask Ubuntu
The answer is quite similar for each distro. It requires you to use the "delay" feature present in these tools. The delay feature...
Read more >
How do you snap a screenshot on Android 9 given a delay ...
So I want to see if a delayed snapshot tool can snapshot in, oh, say, 10 seconds after I initiate the screenshot tool....
Read more >
Screen Capture: The Best Way to Take Screenshots (PC and ...
There are many reasons to take a screenshot (also known as a screen grab or screen capture). Quickly learn how to capture screen...
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