Running Web UI tests in the private mode from the command line
When you play back Web UI tests, if the user profile that is stored in the browser prevents the test from running without intervention, then you can use the private or incognito mode from the command line. Also, when you do not want cookies and caches to affect your test play back, you can choose the private mode.
Before you begin
You must have completed the following tasks:
- Recorded a Web UI test to run in the private mode.
- 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.
Restriction: Web UI tests
contained in multiple groups in an AFT Suite that are configured to run in the
headless mode and in the private mode and grouped based on the browsers are not
supported.
Procedure
-
Create a variable file with the following variable name and its value:
<variable_init name="<browser_name>.private" value="true" />Use the following values for the specific browser:
Browser Value Chrome <variable_init name="chrome.private" value="true" /> Edge <variable_init name="edge.private" value="true" /> Firefox <variable_init name="firefox.private" value="true" /> Opera <variable_init name="opera.private" value="true" /> The sample variable file for running a test in the private mode of Chrome browser is as follows:<?xml version="1.1" encoding="UTF-8"?> <inits xmlns="http://www.ibm.com/rational/test/lt/varinit"> <variable_init name="chrome.private" value="true" /> </inits>
-
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 Rational® Functional Tester, if it is open, before running the cmdline command.
-
Enter the following command to run the test in the private mode:
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\priv.varinit"
The test run starts, and the status is displayed on the screen.