From 6c71f158666fd27dd27269b644034d71774bc376 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 19 Jan 2021 11:38:10 -0800 Subject: [PATCH] docs: add thread-safety notes --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ad46f46c..7db25ac6 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ To run Playwright simply add following dependency to your Maven project: ``` +#### Is Playwright thread-safe? + +No, Playwright is not thread safe, i.e. all its methods as well as methods on all objects created by it (such as BrowserContext, Browser, Page etc.) are expected to be called on the same thread where Playwright object was created or proper synchronization should be implemented to ensure only one thread calls Playwright methods at any given time. Having said that it's okay to create new many Playwright instances each on its own thread. + ## Examples You can find Maven project with the examples [here](./examples).