Juan Carlos Coto
Juan Carlos Coto

Reputation: 12574

How to run multiple Selenium Firefox browsers concurrently?

Trying to run multiple processes concurrently on the same machine, which use Selenium. What would happen is something like this:

python my_selenium_process1.py &
python my_selenium_process2.py &
python my_selenium_process3.py &

As far as I have been able to test, this results in Selenium opening the Firefox instances in sequence, which is not the desired behavior.

Additional note: According to this question on superuser about multiple Firefox instances, the way to do this would be to use the --no-remote start up flag for Firefox. This seems like a good way to go, but I'm not sure if there is a simpler way to do it or if this is even what I'm looking for.

Edit: The purpose, more than speeding up a particular test case, is to allow multiple Selenium processes to run concurrently.

Thanks very much! Any suggestion will be appreciated!

Upvotes: 9

Views: 9761

Answers (3)

Gus
Gus

Reputation: 623

sudo easy_install -U python-wd-parallel

then

check the usage here

https://github.com/OniOni/python-parallel-wd

Upvotes: 3

Ravi Pal
Ravi Pal

Reputation: 395

You can user Selenium Grd 2

  • it allows to scale by distributing tests on several machines ( parallel execution ) Check Out here

Upvotes: 1

Amey
Amey

Reputation: 8548

Have you considered implementing a selenium grid?

Selenium Grid will help you scale by running tests in parallel. Just setup a hub and node with the following commands:

For the hub

java -jar selenium-server-standalone-2.30.0.jar -role hub

and for the node

java -jar selenium-server-standalone-2.30.0.jar -role node  -hub http://localhost:4444/grid/register

Upvotes: 2

Related Questions