← Back to Discord Forum

TimeOut Issue

Hi, Im using Playwright to automate all test cases in my team, so when running them using "npx playwright test" in headless mode sometimes they fails because of exceeding timeout of waiting certain elements, I tried to extend duration but it seems it doesn't help, any idea how can I deal with that? FYI, Im running a lot of scearios in parallel at chromium browser

This thread is trying to answer question "How can I deal with tests in Playwright sometimes failing due to exceeding the timeout for waiting certain elements, especially in headless mode and when running multiple scenarios in parallel?"

5 replies

I have the same issue, especially on CICD. I rerun the failures locally and they all pass. A typical day would look like this: AWS:

94 failed, 845 passed, 8 xfailed, 23 errors in 3442.34s (0:57:22)

Local rerun 1, 117 problems: 16 failed, 94 passed, 7 errors in 532.07s (0:08:52)

Local rerun 2, 23 problems 8 failed, 7 passed, 8 errors in 150.26s (0:02:30)

Local rerun 3, 16 problems 3 failed, 13 passed in 187.56s (0:03:07)

Local rerun 4, 3 problems: 2 failed, 1 passed in 51.25s =

Local rerun 5, 2 problems: 2 passed in 46.26s


Turn on trace and see what is happening in your tests. You might need to increase your timeouts, or you might need to modify your tests to wait for additional things to happen

When I turn on trace, all tests passe OK by running them one after the other, I noticed have timeout issue just in case of "npx playwright test" - headless mode

Any suggestions to this issue ?


An issue with "...sometimes..." is always an investigation issue. Are the same tests failing? Is it the same day-time? Are always the same elements missing? Is there another information possible, like logs on the server and so on?

Related Discord Threads

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.