Rayrun
← Back to Discord Forum

How to reduce browser launch time?

Currently, It is taking more than 1 min for browser launching after configured below anyone of options. Can you please help me how to reduce it?

reportSlowTests: null,

reportSlowTests: {max:0, threshold : 0},

This thread is trying to answer question "How can I reduce the launch time of a browser when using Playwright?"

7 replies
refactoreric

reportSlowTests should not affect browser launch duration. Maybe something else changed which slowed it down?

But now that I think of it, maybe that tiny change caused Playwright's Babel transpilation cache to be outdated, so Playwright will re-transpile everything again? Just guessing a bit. But if that's the issue I'd expect it to be a problem only once.

What version of Playwright are you using? Maybe worth trying to update to the latest (if not already using that)?

not enough info really here, perhaps you're running many API requests prior to launching the browserContext?

tphillips8117

Which browser are you using? Which version of Playwright?

My suggestion is change your url to something link google dot com or amazon dot com and see if still have delays? If yes next item worth to consider looking: Do you have any antivirus scan actively monitoring process launch?

play.wright_71287

My tests also have a long delay. It is tied to the condition when playwright thinks that your page is loaded. in page.goto, you can use options.

in the options there is a waitUntil parameter. You can try changing it to domcontentloaded or load. it solved my problem. https://playwright.dev/docs/api/class-page#page-goto

With connectOverCDP test are running on already opened chrome browser https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp

@refactoreric: using Playwright 1.39.0 version and chrome browser. I have tried other website also and facing same issue. I didn't use anti virus software

using Playwright 1.39.0 version and chrome browser. I have tried other website also and facing same issue. I didn't use anti virus software

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 luc@ray.run.