Running parallel Squish Web tests

Last edited on

Overview

It is possible to execute parallel Squish for Web tests using Firefox and Internet Explorer, providing some initial preparation is made.

Preparations for Internet Explorer

For Internet Explorer no extra steps are required.

Preparations for Firefox

Step #1 - Create profile

For Firefox you must use separate profiles for each Firefox instance. This means creating an additional profile using the Firefox ProfileManager and then choosing a particular Firefox profile using a command line option.

Managing Firefox profiles is described here: Use the Profile Manager to create and remove Firefox profiles .

Step #2 - Register the Squish Firefox Extension for each Firefox Profile

firefox -P mysquishtests file:///C:/Users/myuser/squish-5.0-20140217-1147-web-win32-/lib/squish@froglogic.com.xpi
In a shell/cmd.exe

(Please replace "mysquishtests" and the path in the file: URL according to your local setup.)

Specifying which Firefox Profile to use

squishrunner --testsuite ... --webbrowser firefox --webbrowsersargs "\"-P\" \"mysquishtests\""
In a shell/cmd.exe

(Replace "mysquishtests" with the name of your profile.)

Note: You can change the default Firefox profile by (first closing Firefox; check in process list to make sure) starting Firefox with the "-P" parameter and double clicking on the profile that should become the default.

Running parallel Squish for Web tests using the Squish Hudson Plugin

Support for passing the --webbrowser and --webbrowserargs options has been added in the Squish Hudson Plugin version 1.13 (and higher).

It is possible to specify a particular browser and browser command line arguments by filling in the "Extra options" field of the Squish build step. Here is an example that says to use Firefox with the profile "mysquishtests":

--webbrowser
firefox
--webbrowserargs
"\"-P\" \"mysquishtests\" \"-no-remote\""

Don't get confused by the escaping of the browser arguments. The complete arguments must be enclosed within double quotes and each browser option must be enclosed within double quotes too. To keep the inner double quotes they must be escaped by a backslash.

Using a separate squishserver

One restriction the Squish Hudson Plugin has is that a separate squishserver must be used. By default the plugin starts the squishserver automatically if no arguments for Host and Port are given. This approach fails when executing parallel Squish builds in Hudson.

To use a separate squishserver just start the squishserver, e.g., on port 4711 like this on Windows:

c:\squish\bin>squishserver --port 4711

To use this squishserver inside the Squish build step use 127.0.0.1 as the Host and 4711 as the Port.

Schedule Hudson jobs

Hudson jobs can be built in parallel by using the Hudson job's Build Triggers section's Build periodically feature. The syntax is similar to that used by the Unix cron tool. Further details are provided in the Hudson documentation.

Increasing allowed parallel builds

How many builds will be executed in parallel by Hudson can be configured using Manage Hudson > Configure System > # of executors. This is set to 2 by default.