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:

Procedure

  1. 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>
  2. 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.
  3. Close Test UI, if it is open, before you run the cmdline command.
  4. 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.

Results

You have run the test in the browser with browser launch arguments from the command line.