Skip to main content

Execute mobile tests with Appium 2.x in Katalon Studio (PoC)

Warning:
  • This Proof of Concept (PoC) is not ready for production use. We recommend using this PoC for evaluation purposes only.

Katalon Studio supports seamless integration with Appium 1.x for mobile testing. With the new major release of Appium 2.0, this proof of concept (PoC) provides you the option to execute mobile tests with Appium 2.x. This PoC also contains support for Xcode 14.

When you install Appium 1.x, all available drivers will be installed at the same time as the main Appium server.

In Appium 2.x, one major change is the independence of drivers. The tools and requirements for building and using drivers for different platforms are completely different. The ability to install and work with decoupled web drivers based on your application platform (iOS, Android, etc.) can reduce your setup time and improve mobile testing performance in Katalon Studio.

If your team is migrating from Appium 1.x to Appium 2.x, the changes in Appium 2.0 are not primarily related to changes in automation behaviors for specific platforms.

This document will guide you through configuration steps to execute mobile tests with Appium 2.x.

Requirements

Note:

We recommend downloading and installing Node.js from the official website instead of using package manager (e.g., brew or apk).

Install Appium 2.x and execute mobile tests

This section shows you how to install Appium 2x, install the required drivers for mobile execution in Katalon Studio, and execute tests using Appium 2.x.
  1. Install Appium 2.x via NPM using the following command:
    npm i --location=global appium
  2. Installing Appium 2.0 only installs the Appium server, but not the drivers since all drivers have been isolated from the Appium server app. Install the Appium XCUITest Driver for iOS and Appium UiAutomator2 Driver for Android.
    • The Appium XCUITest Driver, which is based on the Apple XCTest framework, is used for iOS native and web apps (via hybrid mode), and can only be used on macOS. To learn more about Appium XCUITest Driver, refer to the Appium repository on GitHub: appium-xcuitest-driver.

      To install the latest versions of the Appium XCUITest driver, run the following command:

      appium driver install xcuitest
      Note:
    • The Appium UiAutomator2 Driver for Android native and web apps (via hybrid mode) is based on the Google UiAutomator framework. To learn more about Appium UiAutomator2 Driver, refer to the Appium repository on GitHub: appium-uiautomator2-driver.

      To install the latest versions of the Appium UiAutomator2 driver, run the following command:

      appium driver install uiautomator2
  3. In Katalon Studio, select which Appium version to execute your test with. Go to Project Settings > Execution > Mobile and select the option Appium version 2.x (Beta).Appium 2.0 option in Project Settings
    Click Apply and Close.
  4. Execute your mobile test.
After you executed your test in Katalon Studio, switch to the Console tab to check whether Katalon Studio detects the NodeJS location, starts Appium, and loads all drivers you installed as shown below:

In Log Viewer, the example below shows that Katalon Studio has successfully started the application with Appium version 2.x:

To learn more about execution logs in Katalon Studio, refer to the following document: View and customize execution log in Katalon Studio.

For troubleshooting, refer to the following document: Unable to Start Application on this device: Appium directory is invalid.

Building WebDriverAgent for real iOS devices with Appium 2.0 and Xcode 14

If you are using Appium 2.0 and Xcode 14 to run mobile tests with real iOS devices, you need to manually install WebDriverAgent on Xcode.
  1. Open Xcode. In Xcode > Preferences > Account, click Add (+) to enter your Apple Developer Account ID and password.
  2. After installing the Appium XCUITest Driver, navigate to the WebDriverAgent folder in this directory: /Users/<username>/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent
    Double-click on the WebDriverAgent.xcodeproj file in the selected folder to open it in Xcode.
  3. Build the IntegrationApp target with the following steps:
    1. Select the IntegrationApp target. In the Signing & Capabilities section, check the Automatically manage signing box, then choose a team added in Step 1.
    2. On the menu bar, select Product > Build.
  4. Build the WebDriverAgentLib target with the following steps:
    1. Select the WebDriverAgentLib target. In the Signing & Capabilities section, check the Automatically manage signing box, then choose a team added in Step 1.
    2. On the menu bar, select Product > Build.
  5. Build the WebDriverAgentRunner target with the following steps:
    1. Select the WebDriverAgentRunner target. In the Signing & Capabilities section, check the Automatically manage signing box, then choose a team added in Step 1.
    2. On the menu bar, select Product > Build.
You have successfully installed the WebDriverAgent manually.