Using Katalon Studio, mobile testers can design mobile automation tests for both Android and iOS to run on physical devices, cloud services, and emulators.
Subsequently, this tutorial explains how to set up a mobile automation project for Katalon Studio in macOS. Additionally, it assumes that you are familiar with the general principles of automated testing and have minimal knowledge of the Katalon Studio IDE. Subsequently, in this article, we will cover the below topics:
- Setup Prerequisites
- Setup Devices
- Desired Capabilities
- External Library
1. Setup Prerequisites
Katalon Studio requires the latest installation of the following components.
- Appium v1.12.1 or newer
- Xcode 10.2 or newer
- Command-line tool for Xcode
- Carthage 0.33 or newer
- ios-deploy 1.9.4 or newer
- ios-webkit-debug-proxy 1.8.4 or newer
- libimobiledevice 1.2.0 or newer
- usbmuxd 1.0.10 or newer
- WebDriverAgent
Please setup as following steps:
1. Firstly, install Xcode command-line tool. Moreover, Xcode installation can happen via the Mac App Store.
xcode-select --install
|
2. Secondly, install Homebrew (https://brew.sh/) from Terminal:
3. Thirdly, install Carthage (https://github.com/Carthage/Carthage) with Homebrew:
brew install carthage |
4. Fourthly, install Appium.
brew install mode
|
5. Fifthly, install ios-deploy.
brew install ios-deploy |
6. After that, install usbmuxd.
brew install --HEAD usbmuxd
|
7. Seventhly, install libimobiledevice.
brew install --HEAD libimobiledevice
|
8. After that, install ios-webkit-debug-proxy
brew install ios-webkit-debug-proxy |
9. Lastly, WebDriverAgent (https://github.com/facebook/WebDriverAgent), a WebDriver server (https://w3c.github.io/webdriver/webdriver-spec.html) implementation for iOS, is used for controlling iOS devices remotely. Moreover, you need to install and set up WebDriverAgent for Katalon Studio to automate iOS devices.
Additionally, you will need to install and configure Xcode (https://developer.apple.com/xcode/) in case of testing on iOS devices. Consequently, please set up Xcode as following:
1. Firstly, open Xcode > Preferences > Accounts: Add developer’s Apple ID
2. Secondly, open Terminal. After that, enter following commands to initialize WebDriverAgent project:
- Appium 1.15.0+:
cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent
|
- Appium 1.14.2 or older versions:
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/webdriveragent
|
3. Thirdly, log into your Apple developer account. In addition to that, register your device.
4. Fourthly, open project WebDriverAgent.xcodeproj project in the appium-webdriveragent folder with Xcode.
5. Fifthly, select target WebDriverAgentLib > in the Signing section. After that, check Automatically manage signing > select the team.
6. Sixthly, on the menu bar, select Product > Build.
7. Finally, select WebDriverAgentRunner > check Automatically manage signing > select a team. After that, on the menu bar, select Product > Build.
2. Setup Devices
For Android devices:
1. First, turn on the phone’s developer mode (go to Settings > Developer options).
2. Secondly, connect your Android Phone to your computer via a USB cable. Additionally, just confirm if prompted for accepting/trusting the phone.
3. Thirdly, confirm if prompted to accept/trust the device.
4. Fourthly, in the Developer Options on your mobile user interface, enable:
- USB debugging – Debug mode when USB is connected
- Install via USB – Additionally, allow installing apps via USB
- USB debugging (Security Setting) – Moreover, 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. Subsequently, please allow Katalon Studio to install it in this case.
For iOS devices:
1. Firstly, connect your iOS Devices to your computer via a USB cable. Moreover, just confirm if prompted for accepting/trusting the phone.
2. Secondly, if you want to execute your tests using Safari on iOS (mobile browser), make sure Web Inspector is on for Safari (Settings → Safari → Advanced → Web Inspector).
3. Thirdly, enable the service mobile UI automation on the device.
4. Fourthly, connect the iOS device to Xcode.
5. After that, Settings on the iOS device > Developer > turn ON UIAutomation.
6. Additionally, for iOS 8 and higher, you must enable the service UI automation on the device (connect the iOS device to Xcode) as following steps:
- First, plug in the iOS device.
- Secondly, open Xcode on Mac.
- Finally, go to Settings on the iOS device > Developer > turn ON UIAutomation
7. Similarly, for iOS 6 and higher, on your iOS device, go to Settings > Safari > Advanced and enable Web Inspector.
8. Finally, to test an iOS native application file (.ipa or .app file), make sure the application file already exists and signed properly to deploy on the device. Subsequently, follow these steps to check if an application file already exists and signed correctly:
- First, open Xcode and navigate to Windows/Devices.
- Second, choose your device from the Devices list.
- Thirdly, press the “+” button and choose your application file.
Moreover, if installed successfully, the application will appear in the Installed Apps section, as shown below:
3. Desired Capabilities
You can modify extra Desired Capabilities when executing a mobile automation test in Katalon Studio.
To define Desired Capabilities for local execution using Chrome, Firefox, IE, Safari or Edge, please access Project > Settings > Desired Capabilities > Mobile > Android/iOS.
Subsequently, the example below shows the desired capabilities settings for Android to enable Unicode input.
Refer to https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities to know which Selenium supports the properties of each web browser. Moreover, in order to use desire capabilities with Appium, refer to this list: http://appium.io/docs/en/writing-running-appium/caps/.
4. External Library
With this setting, you can manage your external libraries by adding new ones or removing existing ones. Subsequently, please access the settings at the menu Project > Settings > External Libraries.
- Add: Click to add your external libraries. Additionally, the selected libraries will copy to the Drivers folder of the Katalon project. Moreover, now users can use the libraries in their test scripts.
- Remove: To remove imported external libraries, specify the library which you want to delete. After that, click on Remove and click OK.
In addition to above, the added libraries can be imported and utilized in the Script View (https://docs.katalon.com/katalon-studio/docs/create-test-case.html#in-script-view) of Katalon Studio: