Skip to content

katalon-studio/sideload

Repository files navigation

sideload

sideload is a built for executing Katalon Studio tests on App Center Test. App Center Test only supports running tests using supported frameworks such as Appium tests written in Java with JUnit; hence, Katalon users cannot execute their tests on App Center Test directly.

By using sideload to package Katalon projects in JUnit format, you can execute your Katalon test scripts with devices provided on App Center Test. This tutorial shows you how to configure App Center Test, Katalon projects and sideload to execute the usage sample, which is KatalonDemoProject. Also, at the end of this tutorial, we provide some configurations that you can try to execute your Katalon projects on App Center Test.

Prerequisites

You need

Your machine should

Executing KatalonDemoProject

This section guides you on how to upload KatalonDemoProject packaged in JUnit by sideload and start a test run in App Center Test.

  1. Clone or download sideload here.
  2. Open the workspace of the usage example project by following this path src/test/resources/KatalonDemoProject.zip.

On App Center Test, create and start a new test run.

  • Device: Android 7.1.1 or prior. Ex: Motorola Nexus 6
  • Test framework: Appium

To run tests, from the KatalonDemoProject workspace, copy and paste the commands generated automatically in the Submit screen of the New test run dialog

  1. Build and Package all your dependencies using Maven

    $ mvn -DskipTests -P prepare-for-upload package
  2. Upload and schedule tests

    $ appcenter test run appium --app <app_name> --devices <device_id/device_name> --app-path <path_to_app_file> --test-series "master" --locale "en_US" --build-dir target/upload
    • <app_name>: Your App Name on App Center
    • <device_id/device_name>: Device ID or Device Name on App Center (You could find it under the tab Test > Device sets)
    • <path_to_app_file>: The App to upload to App Center

    Usage Example:

    $ appcenter test run appium --app "katalon/demo-app" --devices "katalon/nexus" --app-path "apps/APIDemos.apk" --test-series "master" --locale "en_US" --build-dir target/upload

You can view test reports on App Center Test.

Executing your Katalon test suites

If you'd like to try running your Katalon projects with App Center Test, please make sure you have properly configured your Katalon project and make updates in sideload.

Update your Katalon Studio Project

Before executing any test, you need to create an Appium Driver instance manually and set it as the currently used instance in Katalon Studio.

Open your project in Katalon Studio and put the following snippet at the beginning of your test script or in the Before Test Case listener. Additionally, remember to change the desired capabilities corresponding to your app.

import com.kms.katalon.core.appium.driver.AppiumDriverManager
import org.openqa.selenium.remote.DesiredCapabilities
import io.appium.java_client.MobileElement
import io.appium.java_client.android.AndroidDriver
import io.appium.java_client.remote.MobileCapabilityType

String remoteServerUrl = System.getenv('XTC_SERVICE_ENDPOINT_APPIUM') + 'wd/hub'

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, 'S10 Plus')
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, 'android')
capabilities.setCapability('appActivity', 'com.hmh.api.ApiDemos')
capabilities.setCapability('appPackage', 'com.hmh.api')
capabilities.setCapability('appWaitActivity', '*')
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AppiumDriverManager.UIAUTOMATOR2)
capabilities.setCapability('autoGrantPermissions', true)

AndroidDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL(remoteServerUrl), capabilities)
AppiumDriverManager.setDriver(driver)

Since you have created a custom Appium driver, you need to comment out, or remove all the Mobile.startApplication(...) or Mobile.startExistingApplication(...) in your current test cases.

Update sideload

You need to package your Katalon project into a zip file and place it in the resources folder src/test/resources.

Open src/test/java/com.katalon.sideload/SideloadTest.java, find the sideload test section and change the following variables as your context:

  • katalonProjectPackageFile: Your package file
    • (e.g. "KatalonDemoProject.zip")
  • projectPath: Katalon project's folder name inside the zip package
    • (e.g. "KatalonDemoProject")
  • executeArgs: The arguments part of your Katalon run command
    • (e.g. "-retry=0 -testSuitePath="Test Suites/Regression Tests" -executionProfile="default" -browserType="Chrome" -apiKey="f9074412-f2b0-49a4-b6ef-b0e50f9b59d8"")

    Please note that the -browserType argument must be set to "Chrome".

Then create a new test run in App Center Test and execute the tests.

Companion products

Katalon TestOps

Katalon TestOps is a web-based application that provides dynamic perspectives and an insightful look at your automation testing data. You can leverage your automation testing data by transforming and visualizing your data; analyzing test results; seamlessly integrating with such tools as Katalon Studio and Jira; maximizing the testing capacity with remote execution.

Katalon Studio

Katalon Studio is a free and complete automation testing solution for Web, Mobile, and API testing with modern methodologies (Data-Driven Testing, TDD/BDD, Page Object Model, etc.) as well as advanced integration (JIRA, qTest, Slack, CI, Katalon TestOps, etc.). Learn more about Katalon Studio features.