Document toolboxDocument toolbox

Executions on Perfecto

Introduction

Perfecto is a cloud-based lab for Web and Mobile application testing. It allows running tests in the cloud using different combinations of operating systems, browsers, and browser versions. In this environment, all desktop web application tests are executed on virtual machines (VMs) and mobile application tests are executed on physical devices. Perfecto allows you viewing video recordings of the test case executions after the suite executions are completed.

To know more about Perfecto, click here.

Prerequisite:

  • An active user account on Perfecto.

In this section

Configuring qualitia.properties

After you develop your test cases in Qualitia Automation Studio for Web and Mobile and add them in Suites, you can create an offline package to execute them in the Perfecto environment.

In order to do so, you must configure property files from the offline package accordingly.

  1. Navigate to the folder where you have saved your offline package.
  2. Open the config folder.
  3. Set xmlPath to the location where your test case execution XMLs (including Suite.xml and Map.xml) are stored.
  4. Set LogPath to the folder where your want to store your test cases results.
  5. Edit the qualitia.properties file.
  6. Do one of the following: 
    1. If the test case belongs to Web application, go to the the Desktop Execution Properties section:
      1. Set ExecutionEnvironment as Perfecto and 
      2. Set ScreenCaptureMode as Browser
        OR
    2. If the test case belongs to Mobile application, go to the the Mobile Execution Properties section:
      1. Set MobileExecutionEnvironment to Perfecto and
      2. Set other properties such as MobilePlatform, MobileUDID, and so forth based on your requirements. 
  7. Save changes and close the file.

Configurations for Web Application Testing

To execute Web application test cases in Perfecto environment, you must configure the perfectoweb.properties file accordingly.

This file is located in the config folder of Qualitia offline package.

  1. Navigate to the folder where you have saved offline package.
  2. From the config folder, open the perfectoweb.properties file.
  3. Set pw.url.
    (info) This is the URL to your Perfecto's instance.
  4. Do one of the following:
    • Set pw.securityToken (recommended) or
    • Set pw.user and pw.password to valid values. 
  5. Set all the other desired capabilities such as pw.platformName, pw.platformVersion, pw.browserName, pw.location and so on. 
    (warning) Location is mandatory if you want to execute test case on Mac.
  6. Save and close the file.

Configurations for Mobile Application Testing 

To execute mobile application test cases in Perfecto environment, you must configure the perfectomobile.properties file accordingly.

This file is located in the config folder of Qualitia offline package.

  1. Navigate to the folder where you have saved Qualitia offline package.
  2. From the config folder, open the perfectomobile.properties file.
  3. Do one of the following:
    • Set pm.user and pm.password to valid values or
    • Set pm.securityToken.

      The pm.user, pm.password, and pm.host properties are mandatory when you want to upload the application to Perfecto's repository. 

  4. Set pm.url.
    (info) This is the URL to your Perfecto's instance.
  5. Set pm.automationName.
  6. Set pm.browserName.
  7. Set pm.host.
    (info) It is the location where you have hosted the Perfecto environment.
  8. Do one of the following:
    1. Set pm.deviceName.
      (info) It is the unique identification number of the device you are using from the Perfecto's device repository or
    2. Set the following properties:
      1. pm.manufacturer,
      2. pm.model,
      3. pm.platformName and 
      4. pm.platformVersion.
  9. Set pm.openDeviceTimeout to a valid timeout in minutes as per the requirements. Qualitia sets default wait as 5 minutes.
    (info) As per the time you set here, Qualitia waits for the device to be available in case the device is busy when execution of test case is triggered. 

  10. Do one of the following:

    • To automate testing on a mobile native application, set enableAppiumBehavior as true.

    • To automate testing on a mobile web application:

      1. Set enableAppiumBehavior and useAppiumForWeb as true.

      2. Set AutomationName for Android as Appium and for iOS as XCUITest .

    • To automate testing on an Android hybrid application, set enableAppiumBehavior and useAppiumForHybrid as true.

    • To automate testing on an iOS hybrid application, set enableAppiumBehavior, useAppiumForHybrid, and iOSResign as true.

Qualitia Bot - Execution

After you configure all the files, you can trigger the test case execution by opening the command prompt and navigating to the folder where you saved the Qualitia bot. After navigating to the designated folder: execute the following command;

java -jar qualitiaoffline-xxx.jar

This command executes tests available at the xmlPath mentioned in the qualitia.properties file.

(warning) In case you have multiple versions of java, Qualitia uses the version set against the "JAVA_HOME" system variable under System Properties settings of your computer.

If you have used ID, Accessibility ID, and Class locator types when adding native mobile app objects in Qualitia, Perfercto Appium integration translates these all locator types to xPath at the time of test case execution.

For more information, refer to the PerfectoMobile documentation

Viewing Execution Status and Reports in Perfecto's Execution Center

Once you have triggered the offline execution, you can view the status of your ongoing executions in Perfecto's Execution Center. Each test case appears on dashboard as a single grid with execution status against it. The status is updated after each test execution is completed in Perfecto's environment with its status (FAILED / SUCCESS) against it. Select the test case from the list and click Report from top to view recording of your test case.

Qualitia and Perfecto's reports may mismatch if Qualitia test case contains any situation which ends the WebDriver session. This situation may arise due to the use of actions like Mobile.CloseApp, opening multiple WebDriver sessions in a single test case and so forth.


To view the execution report of Qualitia test cases:

  1. Log on to your Perfecto account. 
  2. From the top right corner, click More > Execution Center.
  3. In the Executions section, select the test case from the list.
  4. Click Report

Different Ways of Setting Properties

The values you provide in default property files (qualitia.properties, perfectomobile.properties, perfectoweb.properties, and so forth) can also be provided using user defined properties file and command line interface as follows: 

1.

Default Property Files (from the config folder of offline package)

This is the set of default Perfecto properties. You can always use this file to add valid values.

2.

User Defined Perfecto Properties

You can create your own file with the set of properties and use when executing test cases in the Perfecto environment. These are called user defined property files. This gives you provision to override the property values given in the default property files (for example: perfectoweb.properties/perfectomobile.properties).  

For example:

  • java -jar qualitiaoffline-x.x.x.jar perfectomobilefilename="D:\\PerfectoData\\perfecto_version01.properties"
  • java -jar qualitiaoffline-x.x.x.jar perfectowebfilename="D:\\PerfectoData\\perfecto_version01.properties"
3.

Command Line Arguments

Along with the two options mentioned above, you can also provide the properties using command line interface as well. Values provided using the command line interface override all the values provided in the default property files (such as perfectoweb.properties, perfectomobile.properties) and user defined properties file. In order to provide arguments from the command line interface, you must enter values in following syntax.

For example: java -jar qualitia-offline-xxxx.jar pm.user=<<perfecto user name>> pm.platformName=Windows

The command mentioned above overrides all the values provided in default property files (perfectoweb.properties/perfectomobile.properties) and user defined property file (if any).

Executing Test Cases Behind Firewall Applications

Few applications are configured to be accessed using private networks. Such applications deny access when they are being accessed from other than local networks and so from Perfecto. Executing test cases on Perfecto for such applications needs special configurations.

Simply download Perfecto Connect client executable that matches your Operating System. You need to execute it on the machine in the private network to allow Perfecto executing tests flawlessly.

For more information on configuration of Perfecto connect, refer to the Perfecto documentation.

To configure perfecto to run test cases for the applications behind firewall:

  1. Download Perfecto Connect executable depending on your OS.
  2. Unzip the folder and run the file using command line interface along with Cloud URL and Security Token
    For example: 

    perfectoconnect.exe -c <Perfecto_Cloud_URL> -s <Security_token>

  3. Executing this file will give you the tunnel ID.
    1. If your test case belongs to mobile application, set this tunnel ID against pm.tunnelId in the perfectomobile.properties file.
    2. If your test case belongs to web application, set this tunnel ID against pw.tunnelId in the perfectoweb.properties file.
      Now you can run test cases from Qualitia Bot.

For more information about this, refer to the Perfecto documentation.