Sudheer Aedama
Sudheer Aedama

Reputation: 2144

Run Selenium tests in parallel for Play Project

I have a Play Project (using Scala) with a bunch of Selenium tests in a file. I am using SBT as my build tool. In my SBT console, I run the tests file using: sbt "test-only test.selenium.MySpec". I see that all the tests are running sequentially even though I have sbt.Keys.fork in Test set to true (it's the default, I believe).

I am using Firefox browser for my Selenium tests. I am on Selenium 2.42.0, Play 2.2.2, SBT 0.13.0 and Scala 2.10.4 if that matters.

Is it possible to run the tests in parallel (on my local machine) ? I have seen other options like Selenium Grid where I can distribute my tests by horizontal scaling, but I am trying to have this setup on my local machine.

Upvotes: 4

Views: 528

Answers (1)

jsuereth
jsuereth

Reputation: 5624

Fork does not mean "run in parallel". Fork means "start a new JVM process to run the tests".

Sbt 0.13.5 has some new/experimental code to run forked tests in parallel. You can enable this via the following setting:

testForkedParallel in Test := true

try it out and let us know if you run into any issues. I expect we'll be investing more time into handling parallel log collection in the future, but for now what's there should be good enough for basic tests and development.

Upvotes: 3

Related Questions