Running tests in the private or incognito mode

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. Also, when you do not want cookies, caches, and user information to affect your test play back, you can choose the private mode.

Before you begin

You must have completed the following tasks:

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.

About this task

You can configure a single Web UI test, compound test with multiple Web UI tests, or an AFT Suite to run in the private mode on any of the following web browsers:

  • Google Chrome
  • Microsoft Edge
  • Mozilla Firefox
  • Opera

To run tests from HCL OneTest UI or a remote agent computer in the private mode, you must select the web browser to be used for the playback, and then select the Private Mode as a preference for the test playback.

To run an AFT Suite in the private mode, you must have entered the web browser to be used for the playback and then enter the private attribute with its value set to true in the AFT XML file of the recorded test.

For example, the entry in the AFT XML file can be as follows:

<browser name=”chrome” private=”true”/>

Notes:
  • To ensure that all the Web UI tests in an AFT Suite run in the private mode, you must enter the private attribute with its value set to true in the AFT XML file. The tests run in the private mode irrespective of the preferences configured for the tests in HCL OneTest UI. The Web UI tests also run in the private mode if you select the Run Distributed Tests option for the run.
  • If you entered the private attribute with its value set to false in the AFT XML file of the AFT Suite, then none of the Web UI tests in the AFT Suite run in the private mode.

Procedure

  1. Perform any of the following actions:
    • Select the private mode as a preference for the test playback. Go to Step 2.
    • Enter the private attribute in the AFT XML file. Go to Step 3.
  2. Start HCL OneTest UI and perform the following steps:
    1. Click Window > Preferences > Test > Test Execution > UI Test Playback > Browser tab.
    2. Identify the panel of the web browser that you want to use for the playback test.
    3. Select the Private Mode option for the browser to run tests in the private mode.
    4. Click Apply and Close.
    5. Run the test.
      Note: If you have not set the preference, you can also select the Private Mode checkbox under the Advanced Playback Options of the Run Configuration dialog box when you click Run Test.

    The test is run in the private mode by using the selected browser.

  3. Open the AFT XML file for editing, and then perform the following steps:
    1. Search and find the browser element.
    2. Append the private attribute along with the name of the browser that you want to use to the browser element row.
      You can enter the name of the browsers as indicated in the following table:
      Browser Enter name as
      Chrome chrome
      Firefox firefox
      Edge edge
      Opera opera
    3. Save and close the AFT XML file.
    4. Run the test.
    The test is run in the private mode by using the selected browser.

Results

You have run a test in the private mode of a web browser either from HCL OneTest UI or from a remote agent.

What to do next

You can perform any of the following tasks: