Using an XML file to run multiple Web UI tests and compound tests simultaneously from the command line
You can use an XML file and the command line to run multiple Web UI tests and compound tests simultaneously on instances of Chrome and Firefox. You can also distribute these tests across multiple remote agent computers. Starting from 9.1.1.1, this feature is also available from the command line.
Before you begin
- See Running multiple Web UI tests on multiple browsers and platforms simultaneously for the installation and shell-sharing requirements for running tests across multiple browsers and remote agents.
- There are licensing limitations when attempting to run multiple combinations of tests, browsers, and remote agents. See Enabling runtime licenses for testing.
Procedure
-
Set up an XML file similar to one of the following samples.
Sample XML file 1
This sample XML file lists the full path to the tests and compound tests to run and the browsers (Firefox, Chrome, or both) on which to run the tests. An XML file such as this one is supported in 9.1 and later.
<?xml version="1.0" encoding="UTF-8"?> <inits> <tests> <test path="/TestProject/CompoundTests/ACompound.testsuite"/> <test path="/TestProject/Tests/AWebTest.testsuite"/> </tests> <browsers> <browser name="chrome"/> <browser name="ff"/> </browsers> </inits>
Sample XML file 2
Starting from 9.1.1.1, you can also list the remote agents where you can run the tests. This sample XML file automatically distributes multiple tests across different browsers, remote agents, and the local computer.
In this sample, tests that run in Chrome use Chrome Device Mode to emulate an Apple iPhone6 Plus and a Google Nexus 5 and also run in Chrome headless mode. With headless mode, tests can run in an automated testing environment where a visible user interface shell is not required.
<?xml version="1.0" encoding="UTF-8"?> <inits> <group> <tests> <test path="/WebUProj/ariesweb1.testsuite"/> <test path="/WebUProj/ariesweb2.testsuite"/> <test path="/WebUProj/ariesweb3.testsuite"/> <test path="/WebUProj/ariesweb4.testsuite"/> <test path="/WebUProj/ariesweb5.testsuite"/> </tests> <browsers> <browser name="chrome" devicemode="Apple iPhone 6 Plus" headless="true"/> <browser name="chrome" devicemode="Google Nexus 5"/> <browser name="firefox"/> </browsers> <locations> <location host="9.113.29.29"/> <location host="9.113.29.30"/> <location host="9.113.29.31"/> <location host="9.113.29.32"/> <location host="civcez228.company1.com"/> </locations> </group> <group> <tests> <test path="/WebUProj/ariesweb6.testsuite"/> </tests> <browsers> <browser name="chrome" devicemode="Apple iPhone6 Plus" headless="true"/> <browser name="firefox"/> </browsers> <locations> <location host="localhost"/> </locations> </group> </inits>
- Change to the directory that contains the cmdline.bat and cmdline.sh files. On Windows™ operating systems, this directory is typically productInstallationDirectory/cmdline, for example, C:\Program Files\__BRAND_NAME__\__SDP_PATH__\cmdline. (Alternatively, you can include the full path on the command line.)
- Issue the cmdline command as shown in the following example for a Windows™ computer. The command requires the name of at least one valid test suite with a specific project, even though the test suites and projects are listed in the XML file. The XML file is specified in the -protocolinput argument. See Running tests from the command line for details about the command line arguments.
Example
cmdline> cmdline.bat -workspace C:\workspaces\workspace -project Demo_Proj -plugins "C:\Program Files\HCL\HCLIMShared\plugins" -eclipsehome "C:\Program Files\HCL\HCLOneTest" -aftsuite "aftSuiteName" -results "Results\webUItest_on_off" -exportlog "C:\temp\webLog.txt"