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

About this task

Any tests that you select for test execution using this feature must meet the following requirements: ​

  • Only Web UI tests and compound tests containing Web UI tests are supported.
  • Web UI tests must always start with a Launch application (not In Application) command.

    Launch application

  • The first test in the compound test must also start with a Launch application.​

Procedure

  1. 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> 
  2. 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\HCL\HCLOneTest\cmdline. (Alternatively, you can include the full path on the command line.)
  3. 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_9011 -project Demo_Proj -plugins "C:\Program Files\HCL\HCLIMShared\plugins" -eclipsehome "C:\Program Files\HCL\HCLOneTest" -suite "Tests\google.testsuite" -results "Results\webUItest_on_off" -exportlog "C:\temp\webLog.txt" -protocolinput "distributed.tests=C:\temp\dfttests.xml"
Feedback