Katalon Studio

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.

Important: This document includes references to a third-party product, Katalan Studio. The user interface and usage of third-party products are subject to change without notice. For the latest published information about Katalan Studio, see https://docs.katalon.com/docs.

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.

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 dialog box opens on the right.
  3. In the Perfecto Integration dialog box, provide information in all the mandatory fields (marked with an asterisk). 

    The value in the Config Name field must be unique.

    For Appium-related configurations, make sure enableAppiumBehavior is set to true.

  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.

    Important: 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.

Pre-conditions

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

 

Change

To

Remove occurrence at end of test

Web

WebUI.openBrowser(“URL”)

PerfectoKeywords.openBrowser(“URL”)

WebUI.closeBrowser()

Native/Hybrid

Mobile.startApplication(“app-path”)

PerfectoKeywords.startApplication(“app-path”)

Mobile.closeApplication()

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

The following table shows example configurations.

Parameter

Web configuration

Mobile web configuration

Perfecto native configuration (legacy)

Config name

Windows10Chrome

iPhone_Web

android_native

Cloud

demo.perfectomobile.com

demo.perfectomobile.com

demo.perfectomobile.com

Security token

<your Perfecto security token>

<your Perfecto security token>

<your Perfecto security token>

Automation name

Selenium

Appium

Appium

Fast web

true

false

false

Platform

Windows

iOS

Android

Platform version

10

   

Device Name

   

111aaaqqq

Manufacturer

 

Apple

 

Model

 

iPhone-8

 

Browser name

Chrome

mobileOS

 

Browser version

beta

   

Additional capabilities

report.tags=test,web,regression;location=AP Sydney;resolution=1024x768

report.tags=regression,mobileweb,ios

appPackage=com.example.package;newCommandTimeout=60;report.tags=test,katalon,native,android

Perfecto keywords

Functionality to implement

Syntax

Perfecto Smart Reporting

PerfectoKeywords.stepStart("description")

Perfecto Smart Reporting's reportiumAssert

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

Media upload to the Perfecto Media repository

PerfectoKeywords.uploadMedia(‘<<PATH TO LOCAL APK/IPA>>’, <<PATH TO PERFECTO MEDIA REPOSITORY>>”)

Perfecto's OCR Click

PerfectoKeywords.ocrClick('label')

Perfecto's OCR Find

PerfectoKeywords.ocrFind ('content’, timeout)

Add global variables

You pass project configurations such as application path, job name, and job number as global variables. The Perfectoplugin 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 name

Value type

Value

TEST_CASE_CONTEXT

Null

Null

reportiumClient

Null

Null

jobName

String

Name of the job

jobNumber

Number

Job number

projectName*

String

Project

projectVersion*

String

1.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.

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

Copy
- GlobalVariable.variableName

For example: - GlobalVariable.appPath

4 | Execute tests

Learn how to execute a single test case, a test case suite, and a test case suite collection in Katalon Studio.

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>.

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>.

To execute a test suite collection:

  1. Open a test suite collection.
  2. In the Execution Information dialog box, 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.

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