Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Selenium use multi threading in one browser?

Tags:

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?

like image 346
Roy Avatar asked Jun 12 '15 17:06

Roy


People also ask

Does Selenium support multi platform?

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.

How do you run parallely tests in different browsers?

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.

Do threads work simultaneously?

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.


1 Answers

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.

like image 78
Vicky Avatar answered Oct 14 '22 15:10

Vicky