Katalon Studio Integration

This guide explains how to create and execute a mobile test with Kobiton devices from Katalon Studio.

Before you start

Make sure you have the following:

  • A Kobiton account. Get the following information from your Kobiton account in the Portal:

  • A Katalon account. There are 2 options:

    • Enterprise account: Supports the Kobiton plugin for performing Spy and Record actions, as well as running test cases on Kobiton devices through the Katalon UI.

    • Free account: Does not support the Kobiton plugin, but you can still run tests on Kobiton devices by manually adding Appium capabilities to your test scripts to point to Kobiton devices.

  • Access to Katalon Studio.

    • For Cloud/Hybrid deployments, use Katalon Studio 9.7.5 or above.

    • For Standalone/On-Prem deployments, use Katalon Studio 10.2.0 or above.

Set up the Kobiton Integration plugin

These features are only available for Katalon Enterprise accounts.

Open Katalon Studio and log in to your Katalon Enterprise account.

Open an existing project or create a new one from the Mobile sample projects (see the sample project below).

Creating a new mobile test project in Katalon with Kobiton sample project template.

Open the Kobiton Integration web page in the Katalon Store. Make sure you are logged into the store using the same account in Katalon Studio.

Select Install.

Go back to Katalon Studio, select the account profile, then select Reload Plugins.

User menu in Katalon Studio with the Reload Plugins option selected.

If the plugin is loaded successfully, the Kobiton Integration plugin displays with the Success status.

Katalon plugin manager showing Kobiton Integration plugin installed successfully.

Close the pop-up, then open Kobiton Integration settings:

  • Windows:

    • From the menu bar, select Window → Katalon Studio Preferences.

      Accessing Katalon Studio Preferences from the Window menu in Windows environment.

  • macOS:

    • From the Katalon menu bar, select Katalon Studio Enterprise or Katalon Studio → Settings.

      Katalon Studio Enterprise menu on macOS with the Settings option highlighted.

  • Linux (Ubuntu):

    • From the menu bar, select Window → Katalon Studio Preferences.

      Katalon Studio Window menu on Ubuntu Linux highlighting the Katalon Studio Preferences option.

The next steps are the same for all operating systems:

  • Expand Katalon, then select Kobiton.

  • In the Kobiton Integration options, check the Enable Kobiton Integration checkbox.

Katalon Studio Preferences screen showing Kobiton integration settings with API key and server configured.

Enter the following information:

  • Kobiton Server.

    • For Cloud/Hybrid environments, enter https://api.kobiton.com/wd/hub.

    • For Cloud/Hybrid environments with custom domain, enter https://api-<custom-domain>.kobiton.com/wd/hub.

    • For Standalone/On-Prem environments, enter [http|https]://[dell_ip_or_hostname]/wd/hub.

  • Username

  • API Key

Select Test Connection to test the configuration. If successful, a message Connection to Kobiton successful will appear. Select Apply and Close.

Perform actions or tests with Kobiton Integration

These features are only available for Katalon Enterprise accounts.

Mark devices as favorites in the Kobiton Portal

Log in to your Kobiton Portal.

Follow this guide to mark any Public or Private and Local devices as favorites.

Device list in Kobiton platform showing favorite Android and iOS devices available for testing.

Only devices that are marked as favorites can be selected in the Spy and Record actions.

Upload application to the Kobiton App Repo (optional)

If you want to test an app not already installed on the device, follow this guide to upload the app to the App Repo.

Kobiton Apps dashboard showing uploaded Android and iOS applications.

Perform Spy or Record actions

Make sure you have marked device(s) as favorites and uploaded application(s) to the App Repo.

Select the Spy or Record icon.

Toolbar controls to start or stop recording mobile test steps.

Select Kobiton Devices.

Device source options in Katalon Studio showing Kobiton Devices selected among Android, iOS, and Remote Devices.

Wait for the device and application list to load.

Under Configurations, select a Device Name.

To install an app from the App Repo, select Application File under Start With, then choose an app from the dropdown.

Mobile configuration panel in Katalon with an application file selected for a Google Pixel 8 Pro.

To test an app already installed on the device, select Application ID under Start With, then input the package name or bundle ID.

Katalon Studio configuration using Application ID to launch an app on Google Pixel 5.

Select Refresh to update the app list if needed.

Select Start to begin the Spy or Record action.

  • Local apps cannot be installed to Kobiton devices in Spy and Record actions. Upload the apps to the Kobiton App Repo or use a direct download URL.

  • The Kobiton Devices option only appears when the Kobiton Integration plugin is enabled.

  • Learn more about the Spy and Record mobile utilities in Katalon documentation.

Run a test

Follow the Katalon official guide to create a test case. You can use the sample Android or iOS project.

Open the test case to test.

Make the following changes:

  • Double-click the input column of the Start Application row.

    The default value of the Start Application step in the test case before editing.

  • Double-click the Value column of the appFile row.

    Configuring local app path using variable input for appFile in test input.

  • Replace it with "<app-version-id>" or "<direct-download-url>. Example: `"kobiton-store:v1" or "https://drive.example.com/sample.apk"

    Setting appFile parameter with Kobiton App ID in test input configuration.

  • Select OK to save the changes.

Select the Run or Debug dropdown icon.

Toolbar buttons to run or debug a test case in Katalon Studio.

Select Kobiton Device.

Device selection dropdown in Katalon Studio with Kobiton Device highlighted.

Wait for the device list to load and choose a device.

Select OK to start the test.

Wait for test execution and view the result.

The Kobiton Device option only appears when the Kobiton Integration plugin is enabled.

Add Appium capabilities to run a Katalon script on Kobiton devices

This process is available for both Free and Enterprise Katalon accounts.

Create a test case in Katalon

Retrieve Appium capabilities for Kobiton devices

  • Log in to the Kobiton Portal.

  • Follow this guide to retrieve the Appium capabilities.

  • Select Java as the language.

  • To test an app that has been uploaded to the App Repo, select Hybrid/Native under App Type, then the app.

  • Copy the capabilities.

Modify the Katalon script to add Appium capabilities

Open Katalon Studio and the test case.

Default view of a test case in Katalon.

Switch to the Script view.

Script view of a test case in Katalon.

Add the following lines before the import directives:

  • Android:

    import org.openqa.selenium.remote.DesiredCapabilities
    import com.kms.katalon.core.appium.driver.AppiumDriverManager
    import com.kms.katalon.core.mobile.driver.MobileDriverType
    import io.appium.java_client.android.AndroidDriver
  • iOS:

    import org.openqa.selenium.remote.DesiredCapabilities
    import com.kms.katalon.core.appium.driver.AppiumDriverManager
    import com.kms.katalon.core.mobile.driver.MobileDriverType
    import io.appium.java_client.ios.IOSDriver

Skip adding imports that are already in the test case.

Replace Mobile.startApplication(…​) with the copied capabilities. Add the following line after:

  • Android:

    AppiumDriverManager.createMobileDriver(MobileDriverType.ANDROID_DRIVER, capabilities, new URL(kobitonServerUrl))
  • iOS:

    AppiumDriverManager.createMobileDriver(MobileDriverType.IOS_DRIVER, capabilities, new URL(kobitonServerUrl))

Example added capabilities:

String kobitonServerUrl = "https://username:apiKey@api.kobiton.com/wd/hub";
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("kobiton:sessionName", "Automation test session");
capabilities.setCapability("appium:app", "kobiton-store:v722859");
capabilities.setCapability("kobiton:groupId", 13622);
capabilities.setCapability("kobiton:deviceGroup", "KOBITON");
capabilities.setCapability("appium:deviceName", "Galaxy Tab S7");
capabilities.setCapability("platformVersion", "12");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("kobiton:retainDurationInSeconds", 0);

Complete example

The below sample code was taken from the test case Verify Correct Alarm Message in Katalon’s Sample Android Project, then modified to include the Kobiton capabilities:

// Start of added import directives.
import org.openqa.selenium.remote.DesiredCapabilities
import com.kms.katalon.core.appium.driver.AppiumDriverManager
import com.kms.katalon.core.mobile.driver.MobileDriverType
import io.appium.java_client.android.AndroidDriver

// End of added import directives.

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.util.internal.PathUtil

import internal.GlobalVariable

Mobile.comment('Story: Verify correct alarm message')

Mobile.comment('Given that user has started an application')

'Get full directory\'s path of android application'
def appPath = PathUtil.relativeToAbsolutePath(GlobalVariable.G_AppPath, RunConfiguration.getProjectDir())

// The below line need to be removed, or commented out from the original script.
// Mobile.startApplication(appPath, false)

// Start of Appium capabilities copied from Kobiton'

String kobitonServerUrl = "https://johndoe:928c807c-6283-459a-9e45-0c13b0f972bf@api.kobiton.com/wd/hub";

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("kobiton:sessionName", "Automation test session");
capabilities.setCapability("kobiton:sessionDescription", "");
capabilities.setCapability("kobiton:deviceOrientation", "portrait");
capabilities.setCapability("kobiton:captureScreenshots", true);
capabilities.setCapability("appium:app", "kobiton-store:v722859");
capabilities.setCapability("kobiton:groupId", 13622); // Group: Test
capabilities.setCapability("kobiton:deviceGroup", "KOBITON");
capabilities.setCapability("appium:deviceName", "Galaxy Tab S7");
capabilities.setCapability("platformVersion", "12");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("kobiton:retainDurationInSeconds", 0);

AppiumDriverManager.createMobileDriver(MobileDriverType.ANDROID_DRIVER, capabilities, new URL(kobitonServerUrl))

// End of Appium capabilities copied from Kobiton'

Mobile.comment('And he navigates the application to Activity form')

Mobile.tap(findTestObject('Application/android.widget.TextView - App'), 10)

Mobile.tap(findTestObject('Application/App/android.widget.TextView - Activity'), 10)

Mobile.comment('When he taps on the Custom Dialog button')

Mobile.tap(findTestObject('Application/App/Activity/android.widget.TextView - Custom Dialog'), 10)

'Get displayed message on the dialog'
def message = Mobile.getText(findTestObject('Application/App/Activity/Custom Dialog/android.widget.TextView - Message'),
    10)

Mobile.comment('Then the correct dialog message should be displayed')

Mobile.verifyEqual(message, 'Example of how you can use a custom Theme.Dialog theme to make an activity that looks like a customized dialog, here with an ugly frame.')

Mobile.closeApplication()

Run the test

Select either the Run or Debug icon.

Toolbar buttons to run or debug a test case in Katalon Studio.

Do not select Kobiton Device from the dropdown as it is already handled by the Appium capabilities.

Wait for test execution and view the result.