Qualitia supports headless executions. In headless mode, executions tests are possible with PC executed without display, keyboard, and mouse. Such executions are known to be faster as compared to normal executions that use a display. You can use Google Chrome and Mozilla Firefox browsers to execute test cases in headless mode.
Table of Contents | ||||
---|---|---|---|---|
|
...
Qualitia supports headless test case execution on following browsers and operating systems.
Windows | Mac | Linux | |
---|---|---|---|
Google Chrome | v60+ | v59+ | v59+ |
Firefox | v56+ | v56+ | v55+ |
Three ways to execute test cases headlessly:
Table of Contents | ||||
---|---|---|---|---|
|
Using googlechromedc.properties / firefoxdc.properties (Chrome/Firefox Options) - Recommended
You can execute test cases headlessly from your Qualitia Bot (erstwhile Qualitia offline package) using some options from the googlechromedc.properties / firefoxdc.properties file.You will find these files in the config folder of Qualitia bot.
For Firefox 56 and above and for Chrome 60 and above, you can execute test cases in headless mode using Chrome/Firefox Options from the firefoxdc.properties or googlechromedc.properties files.
Google Chrome
To execute test cases in headless using mode on Chrome.
- Open googlechromedc.properties.
- In the Chrome options properties section:
- Set custom_use_chromeoptions as True.
- Set args as --headless.
Firefox
To execute test cases in the headless using mode on Firefox.
- Open firefoxdc.properties.
- In the Firefox options properties section:
- Set custom_use_firefoxoptions as True.
- Set args as -headless.
...
Using qualitia.properties (Headless Execution Properties)
You can execute test cases headlessly from your Qualitia Bot (erstwhile Qualitia offline package) using some options from the qualitia.properties file. You will find this file in the config folder of Qualitia bot.
If you are using Mozilla Firefox versions below 56 or Chrome versions below 60, headless executions can be triggered only by setting Headless Execution Properties in the qualitia.properties file. This mode of headless execution works on Linux only.
To execute using qualitia.properties
- Open qualitia.properties.
- In the Headless Execution Properties section:
- Set HeadlessMode as True.
- Set Display and BrowserBinaryPath as per the requirements.
There are multiple configurations and allied software components that are required to support executions in headless mode. In order to execute test cases in headless mode, you need to configure the headless box by installing X Virtual FrameBuffer (Xvfb).
X Virtual FrameBuffer (Xvfb) Installation
The Xvfb helps in performing all graphical operations in memory without displaying any screen output. With reference to Qualitia, Xvfb allows executing test cases performing all UI operations and capturing of screenshots without displaying on the screen. For this reason, it is recommended to set ScreenCaptureMode as Browser when performing headless mode.
To install Xvfb, enter the following command at command prompt:
sudo apt-get install xvfb
Xvfb uses the unique display number to run the operations graphically. Decide any number and turn the access control off entering the following command:
sudo Xvfb :99 -ac
Once this is done successfully, change the properties in the qualitia.properties file as mentioned below.
HeadlessMode=True
DISPLAY=99
ScreenCaptureMode=BROWSER
The following is the list of commands that you need to enter to run the QOP in headless mode
Xvfb :99&
export DISPLAY=:99
java –jar qualitiaoffline-xxxx.jar
...
Note |
---|
Execution using X Virtual Frame Buffer (Xvfb) on Linux is no longer supported. You can execute test cases headlessly on Linux using any of these methods mentioned above. |