Hi everyone! I am running 10 playwright browsers at the same time and out of them only one of them is working properly. I definitely need to run the browsers in non incognito mode. Here is my code:
This is error:
This thread is trying to answer question "Why are only one out of 10 playwright browsers working properly when launched simultaneously?"
What way are you using to start them at the same time? I don't know if Playwright library is thread safe. At least for Python and Java it is not.
And how sure are you that you really need non-incognito mode? Launching 10 browsers instead of just 10 lightweight browser contexts inside the same browser is using a lot more resources.
If all you need is cookies and local storage to be saved/restored, then you could alternatively use the storage state feature. https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state
On the NodeJS side you could probably rely on async instead of threading to do things in parallel. Most of the time the NodeJS code will be waiting for the real work to be done by the browsers.
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 firstname.lastname@example.org.