Running tests by using the browser launch arguments from the command line
You can open the browser with specific browser launch arguments when you play back Web UI tests through the command line. You can specify the required arguments through a variable file.
Before you begin
You must have completed the following tasks:
- Recorded a Web UI test. See Recording a Web UI test.
- Read and been familiar with the command line arguments to use with the cmdline command. See Configuration of test runs from the command line.
- Read and been familiar with the usage of variable files. See Using a variable file.
Procedure
-
Create a variable file with the following variable name and value pairs:
<variable_init name="webui.browserparam.selected" value="true"/> <variable_init name="browser.parameters" value="-<param1>;-<param2>" />The format of the variable file for passing arguments to browsers is as follows:
<?xml version="1.1" encoding="UTF-8"?> <inits xmlns="http://www.ibm.com/rational/test/lt/varinit"> <variable_init name="webui.browserparam.selected" value="true"/> <variable_init name="browser.parameters" value="-<param1>;-<param2>" /> </inits>
The sample variable file for passing arguments to browsers is as follows:<?xml version="1.1" encoding="UTF-8"?> <inits xmlns="http://www.ibm.com/rational/test/lt/varinit"> <variable_init name="RTW_WebUI_Browser_Selection" value="firefox"/> <variable_init name="webui.browserparam.selected" value="true"/> <variable_init name="browser.parameters" value="-private;-headless" /> </inits>
-
Go to one of the following directories:
- <Install_Directory>\cmdline directory that contains cmdline.sh on the Linux operating system.
- <Install_Directory>\cmdline directory that contains cmdline.sh on the Mac operating system.
- <Install_Directory>\cmdline directory that contains cmdline.bat on the Windows operating system.
- Close HCL OneTest™ UI, if it is open, before you run the cmdline command.
-
Enter the following command to run the test with the specified arguments:
cmdline -workspace <workspacename> -project <projectname> -suite <suitename> -varfile <variable_file_full_path>For example:
cmdline -workspace D:\My Workspace -project myProject -suite Tests\myWebUITest.testsuite -varfile "D:\My Workspace\args.varinit"
The test run starts and the status is displayed on the screen.