Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Jan 22, 2020 13:36

Katalon Studio is a comprehensive toolset for web, mobile app, API, and desktop automation testing that helps overcome common challenges in web UI test automation, for example, pop-ups, iFrame, and wait time. It can seamlessly integrate your automated tests into your CI/CD pipeline.

1 | Set up Katalon

  1. Download your OS-specific Katalon Studio: https://www.katalon.com
  2. Install the latest Katalon Studio on your machine.

    If you work with a Mac, add Katalon Studio to Applications and then launch it from Applications only.

2 | Install the Perfecto plugin

The Perfecto plugin for Katalon offers the following features:

  • Automatic generation of custom capabilities that allow the remote driver to connect to Perfecto Cloud devices and automate web, mobile web, and mobile native/hybrid apps.
  • Ability to update the test name, tags, result status, failure reason, reportium assertions, project name, and steps in Perfecto Smart Reporting.
  • Ability to integrate with the CI Dashboard in Perfecto Smart Reporting.
  • Ability to run multiple test cases, test suites, and test suite collections in parallel or sequentially.

You can install the plugin directly or customize it.

On this page:

To install the plugin directly
  1. Sign in to the Katalon store and install the Perfecto plugin directly from: https://store.katalon.com/product/158/Perfecto-Integration#overview-content
  2. Open Katalon Studio and sign in with the same credentials.
  3. In Katalon Studio, click the Account button and select Reload Plugins.

     Click here to view image

  4. Download the latest reportium-java.jar from here: https://repo1.perfectomobile.com/public/repositories/maven/com/perfecto/reporting-sdk/reportium-java/
  5. Go to Project > Settings, select External Libraries in the left pane, add the downloaded reportium-java.jar, click Apply, and then click OK to close the Settings form.

To customize the plugin
  1. Clone or download our Perfecto + Katalon plugin project from GitHub: https://github.com/PerfectoMobileSA/perfecto-katalon-studio-plugin
  2. Open the project in Katalon Studio.
  3. Build the project by running the following command:

    gradle clean build katalonPluginPackage
  4. Copy build/libs/katalon-studio-perfecto-plugin.jar and paste it into the Plugins folder of your Katalon Studio project to use our plugin.

     Click to view image

  5. Download the latest reportium-java.jar from here: https://repo1.perfectomobile.com/public/repositories/maven/com/perfecto/reporting-sdk/reportium-java/
  6. Go to Project > Settings, select External Libraries in the left pane, add the downloaded reportium-java.jar, click Apply, and then click OK to close the Settings form.


3 | Create a custom Perfecto profile

This section explains how to create a new custom Perfecto profile. To edit an existing profile, in the Config Name field, enter the name of the profile you want to edit; then provide the required capabilities and generate the profile. This overrides the previous capabilities.

To create a custom Perfecto profile:

  1. In Katalan Studio, select Project > Settings.
  2. In the left pane, Expand the Plugins section and select Perfecto Integration. The Perfecto Integration form opens on the right.
  3. In the Perfecto Integration form, provide information in all the mandatory fields (marked with an asterisk). 
    The value in the Config Name field must be unique.

     Click to view image
  4. (Optional) To provide additional capabilities in the Additional Capabilities field, use a semicolon (;) as a separator. For example: resolution=1024x768;location=US East;report.tags=smoke,regression
  5. To generate the profile, click Generate Perfecto Custom Profile.

    Note: To save changes, you need to click Generate Perfecto Custom Profile each time you edit a new or existing profile.

    When generated, each custom profile created based on the unique Config Name field is displayed under Custom Capabilities. By default, each profile created with the Perfecto plugin has a prefix of perfecto_. This helps uniquely identify Perfecto profiles.

     Click to view image

Add global variables

You pass project configurations such as application path, job name, and job number as global variables. The Perfecto plugin for Katalon requires global variables to integrate with the CI Dashbard in the Perfecto Test Analysis tab (Smart Reporting), as specified in the following table.

Variable nameValue typeValue
TEST_CASE_CONTEXTNullNull
reportiumClientNullNull
jobNameStringName of the job
jobNumberNumberJob number
projectName*StringProject
projectVersion*String1.0

* Optional variable to group results in Perfecto Smart Reporting

The appPath variable is only required for specifying the location of a native or hybrid app in the Perfecto Media repository.


To add global variables:

  1. In Katalon Studio, in the Test Explorer pane, under Profiles, open the default file and click Add.
  2. Enter the name, select the default type, and enter the default value.
  3. Click OK.
  4. Save the profile.

     Click to view image

To access global variables in the code, use the following syntax:

- GlobalVariable.variableName

For example:

- GlobalVariable.appPath

Pre-conditions

Make sure to adhere to the pre-conditions specified in the following table for web and native/hybrid testing.


ChangeToRemove occurrence at end of test
WebWebUI.openBrowser(“URL”) PerfectoKeywords.openBrowser(“URL”)WebUI.closeBrowser()
Native/HybridMobile.startApplication(“app-path”)PerfectoKeywords.startApplication(“app-path”)Mobile.closeApplication() 

Note: Import com.kms.katalon.keyword.perfecto.PerfectoKeywords in Script view.

The following images show example configurations.

  • Web configuration:
  • Mobile web configuration:
  • Perfecto native configuration (legacy):

Perfecto Keywords

To add a step in Perfecto Smart Reporting, use the following keyword:

  • PerfectoKeywords.stepStart("description")
  • PerfectoKeywords.reportiumAssert("description", true/false)

4 | Execute tests

This section walks you through executing a single test case, a test case suite, and a test case suite collection.

To execute a test case:

  1. Open a test case.
  2. Click the run button.
  3. From the menu that opens, select Custom Capabilities > perfecto_<profile_name>.
 Click to view image

To execute a test suite:

  1. Open a test suite.
  2. Click the run button.
  3. From the menu that opens, select Custom Capabilities > perfecto_<profile_name>.
 Click to view image

To execute a test suite collection:

  1. Open a test suite collection.
  2. In the Execution Information form, do the following: 
    1. Add a profile for each test suite.
    2. Select the Execution Mode as Sequential or Parallel.
    3. Set the max concurrent instance as applicable.
    4. Click Execute to run the entire suite collection.
 Click to view image

CI Dashboard integration

The following images illustrate how Perfecto Smart Reporting displays the results of the Katalon test runs in the Test Analysis view in the Perfecto cloud:

  • A summary of how many tests have passed vs. failed
  • The Report Library, which is a list of all reports, one for each test run, along with status, history information, platform details, and so on
  • The Single Test Report (STR), a single report with detailed steps and screen captures