Using Katalon Studio, a mobile tester can design/fabricate automation tests for both Android and iOS apps on physical devices, cloud services, or emulators.
Subsequently, this tutorial explains how to set up a mobile automation project and test a mobile app using Katalon Studio on Windows. Moreover, this tutorial assumes that you are familiar with the general principles of automated testing and have some experience with Katalon Studio IDE. In this article, we will discuss the below topics:
- Katalon Studio Supported Environment on Windows
- Install Node.js
- Install Appium
- Setup Devices
- Desired Capabilities
- External Library
- Mobile Application
Katalon Studio Supported Environment on Windows
You can just test an iOS application using macOS. However, if you wish to set up your macOS environment for Katalon Studio, please refer to this guide (https://docs.katalon.com/katalon-studio/docs/mobile-on-macos.html).
Unlike Web application testing, to test a mobile app, you require to install Node.js and Appium in addition to Katalon Studio.
- Appium: 1.12.1 onwards.
- Android: 6.x onwards (official releases).
Install Node.js
1. Firstly, download and install Node.js. Follow the steps here.
Note: Ensure that you install Node.js into a location where you have full Read and Write permissions.
2. Secondly, when installing Node.js, make sure to check the Add to PATH option.
3. Thirdly, verify if Node.js installation is correct. After that, open the Windows command line and type the command: where node to see if the system can find Node.js.
Install Appium
1. Firstly, open Command Prompt of Windows and input following command to install Appium:
npm install
-g
appium
2. Secondly, open Katalon Studio and go to the Windows > Katalon Studio Preferences > Katalon > Mobile settings. After that, set the Appium Directory to the installed folder. By default, it’s generally installed at C:\Users\{your login account}\AppData\Roaming\npm\node_modules\appium.
3. Thirdly, you can also specify the level of log details that need to display for Mobile execution using the Appium Log Level as well. Moreover, there are two options: with Info, you can get the log at a simple level while we use Debug in case we want more details logs.
Setup Devices
1. Firstly, install the USB Driver for your phone; you can download it from the device manufacturer site. (In case your Android phone is one of Google Nexus series, please skip this step because Android SDK already includes the driver.)
2. Secondly, turn on the phone developer mode (go to Settings -> Developer options).
3. Thirdly, connect your Android device to the computer using the USB cable. Moreover, just confirm if prompted for accepting/trusting the phone.
4. Fourthly, in the Developer Options on your mobile user interface, enable:
- USB debugging – Debug mode when USB is connected
- Install via USB – Permit installing apps via USB
- USB debugging (Security Setting) – Allow granting permissions and simulating input via USB debugging
5. Finally, install Android SDK: Katalon Studio will detect and ask you to install the Android SDK automatically if your current machine doesn’t have it. Also, please allow the Katalon Studio to install it in this case.
Note: Katalon Studio also supports mobile emulators. You can enable/ start emulators and launch your virtual devices. As long as we can recognize them by using the adb command, it should be fine to execute mobile tests with them.
Desired Capabilities
You can change/ modify extra Desired Capabilities when executing automation tests in Katalon Studio.
To define Desired Capabilities for local execution using Chrome, Firefox, IE, Safari or Edge, please follow Project > Settings > Desired Capabilities > Windows (iOS option is available in macOS)
Starting from Katalon Studio version 7.0, Windows desktop application testing is available.
Refer to https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities for information on which Selenium supports the properties of each web browser. For Desired Capabilities that we use with Appium, refer to http://appium.io/slate/en/master/?ruby#appium-server-capabilities.
External Library
With this setting, you can add or remove your external libraries from Project > Settings > External Libraries.
- Add: Click to add your external libraries. The selected libraries will copy to the Drivers folder in the Katalon project.
- Remove: Click to remove existing libraries. We will remove them from the Drivers folder in the Katalon project.
The added libraries can be imported and utilized in the Script View (https://docs.katalon.com/display/KD/Test+Case+Script+View) of test cases:
Mobile Application
You need to save your mobile application (APK files for Android) to a location where your computer can access/ use with full permission.