Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Does or will playwright support multiple browser instances in the same run? #1736

Closed
hoIIer opened this issue Apr 9, 2020 · 4 comments

Comments

@hoIIer
Copy link

hoIIer commented Apr 9, 2020

For example with a messaging app, it's common to want to test two different clients interacting with some page, is this or will this be possible with playwright?

@mxschmitt
Copy link
Member

You can start multiple browsers and use them also in parallel like this example will show: https://try.playwright.tech/?s=hlae6

To simplify that you could also write some kind of helper function which executes common statements (change the navigation e.g.) via a single function call on all the browsers.

@AutoSponge
Copy link

Running multiple instances (especially in CI) can be limited by resources. Be careful not to spin up too many instances and shut down the ones you're done with. Too many instances in a limited environment will cause all instances to slow to a crawl.

I've had success in most CI environments with 8 or fewer instances. I use an object pool to limit the number of instances and recycle instances when a test suite completes.

@hoIIer
Copy link
Author

hoIIer commented Apr 11, 2020

@mxschmitt thanks, it looks straight forward from the example.. @AutoSponge that's a good point! I like the idea of object pool/recycling.

@hoIIer hoIIer closed this as completed Apr 11, 2020
@mxschmitt
Copy link
Member

(I can recommend bottleneck for that: https://www.npmjs.com/package/bottleneck)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants