Running multiple tests from the command line
When you want to run multiple tests or compound tests that are in a project folder, you can select and run those tests by using any of the command options such as "*" or testType from the command line.
Before you begin
You must have completed the following tasks:
- Recorded multiple tests or created multiple compound tests that are contained in your project folder.
- Read and been familiar with the command-line arguments to use with the cmdline command. See Configuration of test runs from the command line.
Procedure
- Navigate to the directory that contains the cmdline.bat or cmdline.sh file.
-
Enter one the following commands to run multiple tests:
cmdline -workspace <workspacename> -project <projectname> -suite "*"
cmdline -workspace <workspacename> -project <projectname> -testType <testtype_value>
Where,- “*” is the wildcard character enclosed within double quotes that denotes all test assets in the specified project folder.
- <testtype_value> indicates the test type to be selected for test run. HCL OneTest™ UI supports test and compound as <testtype_value>. You can specify the value as test for all individual tests such as Web UI, mobile, HTTP, and Windows tests. For all compound tests, you can specify the value as compound.
You can also use the exclude option “!” along with the wildcard option “*” to exclude the specified test assets.
The following table lists the sample commands to run multiple tests.Option Sample command Description Wildcard character '*' cmdline -workspace “workspace” -project myProject -suite "*" This command runs all the tests in myProject. cmdline -workspace “workspace” -project myProject -suite "test*" This command runs all the tests in myProject that have the file names starting with 'test'. cmdline -workspace “workspace” -project myProject -suite "Compound Tests/*" This command runs all the tests in the Compound Tests folder under myProject. cmdline -workspace “workspace” -project myProject -suite "Web*.testsuite:/myProject2/Test1*.testsuite" This command runs all the tests in myProject that have the file names starting with 'Web' and all the tests in myProject2 that have the file names starting with 'Test1'. cmdline -workspace "workspace" -project "UI1" -aftsuite "AFT*" This command runs all the AFT tests that have file names starting with 'AFT'. Wildcard character '*' with '!" to exclude a specified value cmdline -workspace “workspace” -project myProject -suite "Web*.testsuite:!Web2" This command runs all the tests in myProject that have the file names starting with 'Web', but not 'Web2'. testType cmdline -workspace “workspace” -project myProject -testType compound This command runs all the compound tests in myProject. cmdline -workspace “workspace” -project myProject -testType test This command runs all the Web UI, mobile, HTTP, and Windows tests in myProject.
Results
What to do next
After you run the test, you can verify results in the unified report. See Unified reports for Web UI, mobile, and Windows tests.