25 Apr How can we integrate Kobiton with Katalon Studio?
Kobiton is a powerful mobile device platform that offers real mobile devices for both testers and developers. Katalon Studio is a free and easy-to-use automated functional and regression testing platform. It provides users the ability to implement full automated testing solutions for their application projects with minimal engineering and programming skill requirements. Using Katalon Studio, you can easily execute automated tests on Kobiton's devices. In addition, Katalon has just released the latest version, Katalon Studio 7, with several enhancements and the integration between Kobiton and Katalon has been changed a little bit.
Enable Kobiton Integration
In this blog, I will use the Sample Android Mobile Tests Project on Katalon Studio for the whole guideline. First of all, I will create it as the screenshot below:
Second you need to install the Kobiton Integration plugin. After installing the plugin, open Katalon Studio > your Account > Reload Plugins.
- Open Kobiton integration settings from the main menu:
- Windows: Windows > Katalon Studio Preferences > Katalon > Kobiton
- macOS: Katalon Studio > Preferences > Katalon > Kobiton
- Check on the Enable Kobiton Integration checkbox
- Enter username
- Enter password
- Click Connect button, Katalon Studio will retrieve information for Kobiton integration automatically.
- Then, click Apply and OK button
Display Kobiton devices on Katalon Studio
- Navigate to Kobiton Devices page https://portal.kobiton.com/devices with your credential
2. Click on the Devices menu and select your devices by "Mark as favorite"
3. Just go back to Katalon Studio, from the main toolbar, click on the drop-down menu of Run, and select the option to run with Kobiton Device. We can see the list of devices that we have already bookmarked.
Upload your apps into Kobiton Store or Apps Repo
- Navigate to https://portal.kobiton.com/apps
- Upload your apps (The sample app APIDemos.apk is located on the androidapp folder of this project)
- Select 'More actions' and select Automation snippet
- And then copy kobiton-store value to use for the app capability in your test
Modify Desired Capabilities for Kobiton Devices
- Navigate to https://portal.kobiton.com/devices
- Click Automation settings to get the snippet codes for desired capabilities
3. Modify the sample codes on the Katalon test case. Replace 'Start Application' keyword with these lines. These codes will establish a connection to selected Kobiton's device and also create a driver to be used for other built-in keywords. Thus, you don't have to rewrite the whole test script again.
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject import org.openqa.selenium.remote.DesiredCapabilities import com.kms.katalon.core.appium.driver.AppiumDriverManager import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration import com.kms.katalon.core.mobile.driver.MobileDriverType import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile import com.kms.katalon.core.util.internal.PathUtil as PathUtil import internal.GlobalVariable as GlobalVariable import io.appium.java_client.android.AndroidDriver 'Instead of using Start Application keyword, we use the below code to create a similar driver so that other Mobile built-in keywords can re-use this driver.' String kobitonServerUrl = "https://joeybrown:email@example.com/wd/hub"; DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("sessionName", "Katalon Kobiton Integration"); capabilities.setCapability("sessionDescription", "This is an example for the integration between Katalon and Kobiton."); capabilities.setCapability("deviceOrientation", "portrait"); capabilities.setCapability("captureScreenshots", true); capabilities.setCapability("app", "kobiton-store:184"); capabilities.setCapability("deviceGroup", "KOBITON"); capabilities.setCapability("deviceName", "Galaxy S10+"); capabilities.setCapability("platformVersion", "9"); capabilities.setCapability("platformName", "Android"); AppiumDriverManager.createMobileDriver(MobileDriverType.ANDROID_DRIVER, capabilities, new URL(kobitonServerUrl)) Mobile.tap(findTestObject('Application/android.widget.TextView - App'), 10) Mobile.tap(findTestObject('Application/App/android.widget.TextView-Activity'), 10) 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.TextViewCustomDialog'), 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()
4. From the main toolbar, click on the drop-down menu of Run, and select the option to run with Kobiton Device.
5. Once Katalon Studio is finished, automation test execution will be uploaded to Kobiton. Navigate to Sessions menu to view: