Running a test from the command line
You can run Web UI, mobile, and windows tests using the command-line interface of HCL OneTest™ UI.
Before you begin
- Recorded the tests to be run.
- Created a config file and varfile as required for tests. See Configuration of test runs from the command line.
Procedure
-
Go to one of the following directories:
- <productInstallationDirectory>\cmdline directory that contains cmdline.sh on Linux operating system.
- <productInstallationDirectory>\cmdline directory that contains cmdline.sh on Mac operating system.
- <productInstallationDirectory>\cmdline directory that contains cmdline.bat on Windows operating system.
- Close HCL OneTest™ UI, if it is open, before running the cmdline command.
-
Enter the following command to run the test:
cmdline -workspace <workspacename> -project <projectname> -suite <suitename>
For example:
The test execution starts and the status is displayed on the screen.Note:- The workspace is locked after you issue the command. To check the progress of the test during the run, invoke another workspace and open the project through that workspace.
- On Linux operating system, the command must start with cmdline.sh.
The command line syntax with the supported options is as follows:
cmdline -workspace <workspace_full_path> -project <proj_relative_path> -eclipsehome <eclipse_full_path> -plugins <plugin_full_path> -suite <suite_relative_path> -importzip <full_path.zip> -varfile <variable_file_full_path> -configfile <file_full_path> -results <result_file> -overwrite <{"true" | "false"}> -quiet -vmargs <JVM_args> -publish <serverURL#project.name=projectName -publish_for {ALL,PASS,FAIL,ERROR, INCONCLUSIVE}> -labels <labelname1, labelname2> -exportlog <log_full_path> -exportstats <local_dir_path> -exportstatshtml <local_dir_path> -exportstatsformat <name of the file format> -compare <"result_path1, result_path2"> -exportstatreportlist <stats_list> -execsummary <local_dir_path> -execsummaryreport <reportID> -usercomments <"any user comment"> -publishreports <"FT, STATS, TESTLOG"> -stdout -swapdatsets <existing_dataset_file_path:new_dataset_file-path>
If a value contains spaces, enclose the value in quotation marks. To see the online help for this command while you are in the directory that contains the .bat file, type cmdline -help.
To stop the test run, you can open another command prompt window and use one of the following options with the cmdline option:Command Description -stoprun Optional. Stops the test run after the specified number of seconds. The block is executed, and the test log is transferred before stopping the run. You must use the -workspace command and specify the location of the workspace. -abandonrun Optional. Stops the test run immediately. You must use the -workspace command and specify the location of the workspace. Note: Messages are displayed to indicate when the test is launched and when it is completed unless you include the -quiet option.
What to do next
After you run the test you may want to export the results for further analysis. For more information, see Exporting report counters automatically.