Features
< Back to Blog Overview

Parallel testing with PHPUnit

2012-02-27
Run your Selenium tests in parallel with PHPUnit
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn
  • Share on HackerNews
php testing

One of the advantages of running your Selenium tests on the TestingBot grid is that we scale depending on your needs. If you need to run 100 Selenium tests, it might take some time for them to finish if you run them one after another.


By running tests in parallel, you can dramatically reduce the time it takes to run all your Selenium tests. The same 100 tests can be run x times faster by running them in parallel.


Recently one of our customers asked for a solution to perform parallel testing in PHPUnit. To our surprise this has been on the PHPUnit todo list for a long time, but is still not supported.


We have created a PHP wrapper script which will collect all the PHPUnit files in the directory you specify and run them in parallel. You can specify how many tests you want to run at the same time. At the end of the run, the script will echo the results per PHPUnit file.


An example of how to use this script: php parallel.php -d tests/ -m 5


This will run all tests in the tests directory with maximum 5 simultaneous tests running. Together with our scaleable grid, parallel testing will make your tests results available much faster.


Our GitHub repository with the parallel PHPUnit code: https://github.com/testingbot/phpunit-parallel.

TestingBot Logo

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.

Other Articles

TestingBot Jenkins Plugin

We're happy to release our first TestingBot plugin for Jenkins. Jenkins is a CI (continuous integration) system which runs your tests, with lots of...

Read more
blank

In this post you'll find a small tutorial on how to use Cucumber and Capybara to run Selenium tests on our Selenium grid. Cucumber is Aslak Helle...

Read more
blank

If you haven't heard of Behat yet, it's a BDD framework which runs on PHP written by Konstantin Kudryashov. Behat is similar to Cucumber for Ruby, ...

Read more
Selenium cloud testing with Jenkins

Jenkins (formerly known as Hudson) is an open-sourced continuous integration (CI) system built in Java. With Jenkins you are able to run your Selen...

Read more
Browser statistics gathered from Selenium testing

This week we've reached the 35,000 tests milestone so we thought it might be interesting to do some research in the statistics we've gathered durin...

Read more
Video Record your Selenium Tests

When a Selenium test fails, you usually get a clear error message or trace to indicate where the problem is located.&nbsp;A video of your Seleniu...

Read more