Running tests in the headless mode
When you do not want to view the GUI of the application under test as the recorded test is played back on a web browser, you can choose to run the test in the headless mode. Running of tests in the headless mode is useful when you use an automated testing environment.
Before you begin
You must have recorded a single Web UI test, compound test with multiple Web UI tests, or an AFT Suite that you want to run in the headless mode.
About this task
- Google Chrome
- Microsoft Edge
- Mozilla Firefox
You can configure a single Web UI test, compound test with multiple Web UI tests, or an AFT Suite to run in the headless mode from HCL OneTest™ UI or a remote agent computer by performing any of the following actions:
- Select the Headless Mode option as a preference for the test playback, if you do not enter the headless attribute and its value in the AFT XML file of the recorded tests or AFT Suite. You must also select the web browser to be used for the playback.
- Enter the headless attribute with its value set to
true in the AFT XML file of the
recorded test. Note: You must have entered the web browser to be used for the playback in the AFT XML file of the recorded tests or AFT Suite.
For example, the entry in the AFT XML file can be as follows:
<browser name=”chrome” headless=”true”/>
- To ensure that all Web UI tests in an AFT Suite run in the headless mode, you must enter the headless attribute with its value set to true in the AFT XML file. The tests run in the headless mode irrespective of the preferences configured for the tests in HCL OneTest™ UI. The Web UI tests also run in the headless mode if you select the Run Distributed Tests option for the run.
- If you entered the headless 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 headless mode.
Procedure
- Perform any of the following actions:
-
Start HCL OneTest™
UI and perform
the following steps:
- Click tab.
- Identify the panel of the web browser that you want to use for the playback test.
- Select the Headless Mode option for the browser that you want to use to run tests in the headless mode.
- Click Apply and Close.
- Run the test.
The test is run in the headless mode by using the selected browser.
-
Open the AFT XML file for editing, and then perform the
following steps:
The test is run in the headless mode by using the selected browser.