Closed chenhaijun02 closed 1 year ago
Hello! There's built-in multithreaded functionality if you use pytest -n=4
(for 4 threads) for example. That will spin up 4 different browsers for your tests, where each one has its own cache.
There are several examples in https://github.com/seleniumbase/SeleniumBase/tree/master/examples for login, and there's also a few examples of TinyMCE text editors.
Hello! There's built-in multithreaded functionality if you use
pytest -n=4
(for 4 threads) for example. That will spin up 4 different browsers for your tests, where each one has its own cache. There are several examples in https://github.com/seleniumbase/SeleniumBase/tree/master/examples for login, and there's also a few examples of TinyMCE text editors.
Thank you very much for your answer, but I currently have account 1 in case1 and need to log in. Case2 also requires account 1 to log in. Using -n=2 will open two windows for account 1 login. But only one can log in successfully, and the other is 403
Then it sounds like that website doesn't allow multiple logins by the same user at the same time. Rather than trying to multithread your tests, reuse the session with pytest --rs
so that the browser window stays open, and tests run faster.
Then it sounds like that website doesn't allow multiple logins by the same user at the same time. Rather than trying to multithread your tests, reuse the session with
pytest --rs
so that the browser window stays open, and tests run faster.
Thank you so much!!!
Hi I'm a beginner and I'm writing a script using this framework. The current scenario is that editor and approver login operations are required in each case. Is there a good way to avoid account conflicts in the case of multi-threaded operation?