Document toolboxDocument toolbox

Header

Work with Offline Packages

Qualitia Automation Studio (QAS) offers the ability to create and execute tests in offline mode. An offline suite is a copy of a test suite that you can save on a local machine. You can execute an offline suite on local, remote, shared drive, and cloud environments. 

For Software Development Engineers in Test (SDET), executing tests offline provides flexibility, especially when there is no immediate access to the main software or in environments with limited connectivity.

This guide will walk you through the process of setting up and executing tests offline.

📚Prerequisites

  • Access to QAS - Client.

  • Familiarity with the project you are testing.

  • Custom browser profile on your computer, if required.

Understanding Offline Packages and Suites

If you are traveling or working in a location with unstable internet, you may need to execute tests without connecting to the QAS - Client. In such cases, an Offline Package lets you run tests without accessing QAS - Client. An offline suite is a local copy of a test suite, and it can run on various environments like local machines, remote servers, shared drives, or even cloud setups without having to use up any QAS licenses.

Create an Offline Package

Before running tests offline, you need a package containing all the necessary components. This is a one-time activity that is useful to execute any number of offline suites.

  1. Login to QAS - Client.

  2. Select the project for which you want to download the offline BOT.

  3. From the left navigation menu, go to Qualitia BOT.

  4. Select a folder to save the Offline BOT and click OK.

    1. A file named Qualitia Offline.zip is generated.

  5. To proceed, extract or unzip the Qualitia Offline.zip file.

Create an Offline Suite

The offline suite contains the associated test cases and test data, and a mapped execution profile that are used to execute it.

To create an offline suite:

  1. Login to QAS - Client.

  2. Select the project from which you want to create an offline suite.

  3. From the left navigation menu, go to Execute tab.

  4. From the left pane, select a test suite, and check the test cases you want offline.
    Note: Test cases should be marked for execution.

  5. Click Save.

  6. Click Export Execution Files option from menu.

    1. Click the dropdown and select Export the published testcases to export only the published test cases.

  • By default, all desktop projects use the System Execution Profile.

  • Select a test case that needs to be exported, if a test case is not marked, you will get a popup Mark at least one test case to export the Suite.

  • If before exporting some test cases go out of sync, then you will see a sync popup. Click on the sync option to sync the test cases.

Configure Settings for Offline Suite

Similar to online tests, your offline tests also need specific settings or configurations.

The Offline Package contains a Qualitia Offline Configuration Manager. You can use it to modify the Qualitia Client Settings, Environment Variables, and Execution Profile settings for an offline suite. Also, you can map an offline suite with an execution profile, which is used when the offline suite is executed. 

To configure the settings for an offline suite:

  1. Open the extracted Qualitia Offline file from the previously mentioned Create an Offline Suite procedural steps.

  2. From the Configuration Manager folder, double-click the Qualitia Offline Configuration Manager.

  3. Do one of the following:

    1. Click Browse next to Select the Suite Directory, and then locate and select the offline suite.

    2. Enter the location path of the offline suite folder, and press Tab.

  4. From Select the profile to edit, select an execution profile for the test suite.

    1. The Qualitia Offline Configuration Manager shows the offline suite name and the selected execution profile.
      Note: The offline suite executions that are created to automate testing on a desktop application uses the default execution profile only.

  5. From the Mapped Profile list, select an Execution Profile you want to use.

    1. The default Execution Profile is the one saved during offline suite creation.

  6. You have the option to edit one or more settings, if required:

    1. To update Qualitia Client settings, click the Qualitia Client Settings tab. For more information, refer to Configuration and General Settings.

    2. To change the value of environment variables, click the Environment Variable tab. For more information, refer to Environment Variable.

    3. To update header values, go to the Rest Generic Header tab.

      1. Opt for this only if Rest Generic Headers are used in the test cases.

    4. To update settings for the selected execution profile, click the Execution Profile tab. For more information, refer to

      1. Configuring the System Execution Profile for Web and Mobile Projects: Shows the details on how to automate testing on web and mobile applications.

      2. Configuring the System Execution Profile for Desktop Projects: Shows the details on how to automate testing on a desktop application.

    5. Once updated, click OK to save the changes.

Execute Offline Suite Using CLI Commands

The offline package runs the chosen offline suite with its set execution profile, which can be customized to override pre-configured settings.

  1. If testing on a mobile platform, ensure the execution profile has the right system requirements and settings.

  2. For remote or cloud executions, follow the guidelines for the respective environments. 

To execute an offline package using CLI commands.

  1. Open the Command Prompt.

  2. Go to the location where you have saved the offline package.

  3. Enter the following code: java -jar qualitiaoffline-9.0.x.jar

    1. The offline package is executed using the settings defined in the Qualitia Offline Configuration Manager.

  4. Override any of the following parameters:

    1. Mapped Execution Profile – Enter the location of the Execution Profile you want in the following ways:

      1. The location of the execution profile must be enclosed by double inverted commas. Note that you do not require any key.

      2. Your first argument must be as follows: java -jar qualitiaoffline-9.0.x.jar "D:/ABCsettings.JSON

    2. Offline Suite – Enter the location of the offline suite as SuitesDir="Suite_Path".
      For example, java -jar qualitiaoffline-9.0.x.jar SuitesDir="D:/OfflineSuite/Suite1"

    3. Environment Variable – Enter the environment variables and their associated values in the following format: java -jar qualitiaoffline-9.0.x.jar env.var1=value1 env.var2=value2. Here, var1 and var2 denote the environment variables, and value1 and value2 denote the associated values. For example, java -jar qualitiaoffline-9.0.x.jar env.username=john.smith env.password=12345

    4. Other Parameters defined in the selected Execution Profile – Enter the parameters preceded by their hierarchy in name=value format as command-line arguments. For example, to use a specific version of Google Chrome, enter the command line argument as follows - java -jar qualitiaoffline-9.0.x.jar googleChrome.version=81.0.1.36 . In this example, Google Chrome is the topmost parameter followed by its version. You may provide multiple property-value pairs separating them with space, as shown in the following example - java -jar qualitiaoffline-9.0.x.jar googleChrome.version=81.0.1.36 PageTimeoutInSeconds=10.

      1. If you are overriding the mapped execution profile, enter it as the first argument as this - java -jar qualitiaoffline-9.0.x.jar "D:/ABCsettings.JSON" googleChrome.version=81.0.1.36 PageTimeoutInSeconds=10

      2. If a key has a dot in its name, you need to put backslash before the dot, such as  chrome.chromedriverVersion, which is under Android Chrome as shown here -
        java -jar qualitiaoffline-9.0.x.jar androidChrome.chrome\.chromedriverVersion=83

  5. Press Enter to start the offline suite execution.

 To execute a test suite on a mobile platform, ensure that you have configured the system requirements and settings in the associated execution profile. To execute the offline suite on remote or cloud platforms, then you must follow the appropriate environment guidelines. For more information, refer to Supported Environments Guidelines.

View Offline Suite Execution Report

After running the tests, you would want to review a comprehensive report to analyze the results.

  • You can check the results on the Real Time Reporting Portal.

  • Additionally, the offline suite creates a detailed summary report based on the location set in the Qualitia Offline Configuration Manager > General Settings tab.

  • You can manually upload the locally saved report, if it is not available on the Real-Time Reporting Portal for any of the following reasons:

    • Qualitia Server URL is not configured in the offline suite.

    • Connection to Qualitia Server fails during offline suite execution.

Edit Test Data for Offline Suite

You can edit test data for an offline suite either using Qualitia Client or test data Excel file present in Offline Suite folder.

Editing the Test Data using Qualitia Client

  1. Open your test case from the client.

  2. Access the Test Data explorer to edit.

  3. Once done, re-create the offline suite. Refer to the section Work with Offline Packages.

Edit Test Data Using Test Data File

You can edit the test data directly in the Excel file located in the Offline Suite folder. However, it is recommended to edit through the Qualitia Client as it provides error alerts for incorrect data modifications.

 Qualitia recommends using the Qualitia Client because it displays error message when change in test data is incorrect.

In scenarios where access to Qualitia Client is limited, the offline suite provides flexibility by allowing you to directly modify test data through the Excel file present in Offline Suite folder.

After the offline suite is created, for every test case that contains test data, the associated test data as excel files are created in the same folder with the same names as given to their associated test cases. You can modify the test data such as replace the existing test data and enable or disable TC iterations.

📚Prerequisites

  • An offline suite with associated test data.

  • Basic knowledge of Excel and data formats.

Basics of Editing Test Data

You want to quickly adjust test data without altering the structure of the file.

Steps to Modify Test Data for an Offline Suite

  1. Go to the Offline Suite folder.

  2. Backup the test data file you want to edit.

  3. Open the test data Excel file.

  4. You can update the values for the below fields, as needed.

    1. TC Iteration: Shows the number for every TC Iteration. There must be at least one TC Iteration for executing the test case.

    2. Selection: Shows True for the enabled test case iterations; otherwise, it shows False. You can modify the values only for test case iterations.

    3. DataSetTag: Optionally, enter a label for identifying the dataset in the test case execution report. You can modify the values.

  5. To add a TC iteration, insert a row with values for TC Iteration Number, Selection, and DataSetTag (optional).

  6. For adding a task iteration, insert a row with values for associated parameters.

  7. Save the Excel file after editing.

Execute Offline Suite on a Shared Drive

You can execute an Offline Suite present in a shared drive for web and mobile applications in one of the following ways:

  • By mapping the shared drive to the local computer.

  • Without mapping the shared drive to the local computer.

Execute a Shared Offline Suite by Mapping

For a more seamless experience, you might prefer mapping the shared drive to your local system.

  1. Copy both the offline package and suite to the shared drive.

    1. Ensure you have the read and write permissions.

  2. Map this shared drive to your local computer.

  3. Update the offline suite settings, as required.

    1. For details, refer to Configuring the Settings for an Offline Suite.

  4. To execute, follow one of these approaches:

    1. Using the Command Prompt, go to the mapped location and execute the offline package with the right command.

      1. For details, refer to section Executing Offline Suite using CLI Commands.

    2. Open the mapped driver and simply double-click the offline package (9.x.x jar).

Execute a Shared Offline Suite Without Mapping

To execute a shared drive without mapping the shared drive to the local computer:

  1. Copy the offline package along with the offline suite to the shared drive.

    1. Ensure you have the read and write permissions.

  2. Open the shared location and double-click the offline package (9.x.x jar).

Execute Offline Suite for Desktop Applications on a Shared Drive

You can execute an offline suite present in a shared drive for desktop applications.

Before you execute an offline suite for a desktop application, ensure that you have:

  1. Installed UFT on the same computer from where you will execute the offline suite.

  2. Mapped shared drive to local computer.

  3. Copied offline package to shared drive with read and write access.

  4. Copied TSR file in the local or shared drive and ensure you have access.

To execute offline suite for desktop applications on a shared drive:

  1. Configure the offline suite as per the requirements. For detailed instructions, refer to Configuring the System Execution Profile Settings for a Desktop Project.

  2. Do one of the following: 

    • Open command prompt, navigate to mapped drive location that contains the offline package and offline suite.

    • Navigate to the mapped drive location that contains the offline package and the offline suite and double-click the offline package (9.x.x jar).

Execute Offline Suites using CLI

Qualitia supports integration with Continuous integration tools like Jenkins, TeamCity, and Bamboo. It enables developers to find and solve defects in a code base rapidly and to automate testing of their builds.

When you want to execute your test cases using CI tools, you must set the CI_Tool property in the mapped execution profile.

If your test case is for mobile applications, Appium Server is internally hosted on Qualitia client. However, still you can use a custom Appium server if you want to test on another Appium version. 

Executing an Offline Suite from a Shared Drive without Local Mapping

Method: Direct execution from the shared drive. Steps:

  1. Copy both the offline package and suite to the shared drive, ensuring you have read/write permissions.

  2. Directly access the shared location and initiate the offline package by double-clicking on the 9.0.x jar file.

Execution using Continuous Integration Tools

Method: Integration via QAS settings.

  1. Ensure QAS's capability to integrate with CI tools like

    1. Jenkins

    2. TeamCity

    3. Bamboo.

  2. For mobile application tests, even though QAS hosts the Appium Server internally, use a custom Appium server for different Appium versions if needed.

  3. Set the CI_Tool property in the mapped execution profile before starting.

Headless Executions

Method: Browser-based testing without GUI.

Steps:

  1. Recognize that headless executions run faster since they don't launch the browser UI. QAS supports this for Google Chrome and Mozilla Firefox.

  2. To execute tests in headless mode:

    1. Via QAS Client/OfflineConfigManager:

    2. Open the associated execution profile.

    3. Choose the browser.

    4. Activate the respective headless setting, via CLI:

      1. For Chrome: java -jar qualitiaoffline-xxxx.jar googleChrome.chromeOptions.args=--headless

      2. For Firefox: java -jar qualitiaoffline-xxxx.jar firefox.firefoxOptions.args=--headless

 

Method: Setup via Qualitia Client or OfflineConfigManager.

Steps:

  1. Open the associated execution for a test suite.

  2. From the Browser list, select either Chrome or Firefox.

  3. Check the Desired Capabilities checkbox.

  4. Based on your browser choice:

    1. For Chrome:

      1. Select the chromeOptions checkbox.

      2. Check the args checkbox.

      3. Input --headless in the associated field.

    2. For Firefox:

      1. Select the firefoxOptions checkbox.

      2. Check the args checkbox.

      3. Input --headless in the associated field.

  5. Click Ok.

 

Method: CLI-based execution for headless mode.

Steps:

  1. Open the Command Prompt.

  2. Navigate to the directory containing the offline package.

  3. To run on Chrome, use: java -jar qualitiaoffline-xxxx.jar googleChrome.chromeOptions.args=--headless

  4. For Firefox execution, input: java -jar qualitiaoffline-xxxx.jar firefox.firefoxOptions.args=--headless

🔧 Got a problem? Let’s fix!

  1. Execution is getting aborted after triggering the suite for offline execution. “Fatal exception during execution”: You might get this error if the Test Case name contains slash (/). To successfully execute an offline suite, avoid using slash in the Test Case name.

Footer