I want to test a web in multi threading but when I open too many chromedrivers they use too much memory. Can I use multi threading in one browser?
Selenium enables creating the testing suite on any platform and executing the test cases on a different one. For example, the tester could create the test cases using Windows OS, and then run it on a Linux based system. Selenium supports OS X, all versions of MS Windows, Ubuntu and other builds with ease.
With Parallel Testing, you can run the same test on different browser/device combinations i.e. cross-browser testing, or run different tests on the same or different browser/device combinations. Parallel Testing will help you reduce the run time of your test suite, resulting in faster build times and faster releases.
Concurrency and Parallelism In a multithreaded process on a single processor, the processor can switch execution resources between threads, resulting in concurrent execution. Concurrency indicates that more than one thread is making progress, but the threads are not actually running simultaneously.
WebDriver is not thread-safe. The issue of thread-safety isn't in your code but in the actual browser bindings. They all assume there will only be one command at a time (e.g. like a real user). But you can on the other hand instantiate one WebDriver instance for each thread but it will launch multiple browsers which will consume more memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With