Best Practices for Cross-Platform Mobile Test Automation
Katalon offers everything needed to get started in one platform, including the Page Object Model (POM) design pattern, dependencies and tools, without the technical know-how. Its approach is similar to web automation, with keywords, test data, folders, and integrations. Katalon allows testers to automate native, hybrid, or mobile web applications, making it a versatile tool for mobile test automation.
Now, let’s dive into the best practices for achieving successful cross-platform mobile test automation using the built-in capabilities of Katalon Studio:
Page Object Model (POM)
Apply the Page Object Model (POM) design pattern for your mobile test automation project. The POM principle separates page elements and their actions from the test scripts, making it easier to maintain and reuse them for both iOS and Android applications.
In Katalon Studio, we use the same approach with a slightly different implementation: applying the concept of Object Repository (page elements) and Test Case (interactions/validations), as can be seen in the following image:
Platform-Independent Locators
Using platform-independent locators is a key element in the success of cross-platform mobile test automation using Katalon Studio. Platform-independent locators ensure that your test scripts can seamlessly work on both iOS and Android applications without the need for extensive modification. These platform-independent locators comply with both of Appium’s UIAutomator and XCUITest drivers (selected/defined via the Locator Strategy dropdown in the object spy / object properties feature).
Here’s an in-depth look at this best practice:
2.1. What Are Platform-independent Locators?
Platform-independent locators are locators for mobile elements within your application that work across both iOS and Android platforms. In the context of Katalon Studio, these locators are typically defined using the Object Repository, which acts as an intermediary between your test scripts and the mobile devices.
Key platform-independent locators include:
- Accessibility Locators (Appium Accessibility ID): These are unique identifiers that you can assign to elements in your app, making them easily locatable. Accessibility locators are a recommended choice for cross-platform testing because they are consistent across both iOS and Android.
- XPath and CSS Selectors: While less platform-independent than Accessibility Locators, XPath and CSS selectors can still be used for cross-platform testing. However, you may need to tweak them slightly to accommodate platform-specific differences.
2.2. Advantages of Platform-Independent Locators:
- Reusability: One of the primary benefits of platform-independent locators is that they can be reused across both iOS and Android test scripts. This reduces the effort required to maintain your test scripts and locators, making your test automation more efficient.
- Simplified Maintenance: When elements in the application change or evolve, you can make updates to platform-independent locators in one place, and the changes will propagate to both iOS and Android test scripts. This significantly simplifies maintenance.
- Enhanced Test Script Portability: Using these locators ensures that your test scripts are more portable and less reliant on specific platform details. This portability can save time when adapting your tests to different applications or when switching between platforms.
2.3. Tips for Using Platform-Independent Locators:
- Naming Conventions: Consistently name your Accessibility IDs to reflect the function or purpose of the element. This not only aids in locator management but also improves code readability.
- Element Hierarchy: When defining XPath or CSS selectors, try to rely on the element’s hierarchy within the app’s user interface rather than hardcoding absolute paths. This makes the locators more robust and adaptable to changes.
- Validation: Regularly validate your locators against both iOS and Android applications to ensure that they still work as expected. This helps catch any platform-specific issues early in the development process.
- Responsive Design: Account for responsive design principles when designing your locators. Elements might be positioned differently on different platforms, so your locators should be designed to handle these variations.
Data-Driven Testing
Leverage Katalon’s data-driven testing capability to test the same functionality with various data inputs. This approach helps ensure the app’s compatibility on different devices and under various conditions.
Comprehensive Error Handling
Increase the use of Katalon’s ability to handle errors gracefully in your test scripts. Make sure to review the execution logs to assist in manageable troubleshooting. Katalon’s robust error handling ability ensures the stability and reliability of your tests.
Test on Real Devices and Emulators
Test your mobile applications on both real devices and emulators to cover a broader range of scenarios. Real devices can reveal platform-specific hardware and connectivity issues, while emulators provide a cost-effective way to conduct tests in parallel.
Continuous Integration
Integrate your mobile test automation into your continuous integration (CI) pipeline. Regularly run automated tests on both iOS and Android to catch regressions early in the development process.
Parallel Test Execution
Leverage Katalon Studio’s parallel execution capabilities to run tests simultaneously on multiple devices. This reduces testing time and increases coverage.
Regular Maintenance
Continuously update and maintain your test scripts and object locators as the application evolves. Maintain clear documentation for easier collaboration within your team.
Collaboration and Communication
Foster collaboration between your development and testing teams. Encourage communication to share insights and resolve issues effectively. Cross-platform testing is a team effort.
Performance Testing
Include performance testing in your mobile test automation strategy. Ensure that your application performs optimally on both iOS and Android devices. Leverage Katalon’s ability to integrate with several industry-leading performance testing tools.
Tips for Mobile Testing
Here are the main tips for mobile app testing:
- Learn the app you are testing
- Recall differences between desktop and mobile
- Use real devices if possible
- Document your findings
- Use the development menu for iOS and Android
- Vse emulators and simulators for mobile testing
- Verify the functionality and performance of your app
- Get users to test your app
- Consider the human factor
![Katalon Automation Lesson 14 - Mobile (Android) Automation |Appium| Mobile Automation Test| NodeJS Katalon Automation Lesson 14 - Mobile (Android) Automation |Appium| Mobile Automation Test| NodeJS](https://kientrucannam.vn/wp-content/uploads/2024/02/hqdefault-59.jpg)
Benefits of Katalon for Mobile Test Automation
Katalon offers everything needed to get started in one platform, including dependencies and tools, without the technical know-how. Its approach is similar to web automation, with keywords, test data, folders, and integrations. Katalon allows testers to automate native, hybrid, or mobile web applications, making it a versatile tool for mobile test automation.
Katalon also offers practical scalability and maintenance, as the same scripts and object locators can be used across iOS and Android. Its visual testing feature allows for keyword-based AI without the hype, enabling testers to easily verify layout and content. Additionally, Katalon’s cloud-based capabilities (TestOps, TestCloud) provide scheduling, executions, and reports, allowing testers to easily manage and execute their tests on a remote server.
Requirements
-
Katalon Studio: running on both Windows and macOS with a beta Linux support. Visit the Katalon Studio website to get the latest version.
-
Verify if your computer meets the System Requirements of Katalon Studio.
-
A Katalon account to activate this automation tool. If you don’t have one, provide your desired username and password to sign up after launching the app.
-
Check out Quick Start to familiarize yourself with Katalon Studio.
Web application testing can be directly executed on a mobile device. To do so, you need to connect your testing devices/emulators to a machine and run test scripts. Make sure Chrome and Safari applications are installed so that test steps can execute properly.
It requires some knowledge of working with OS, Appium, and devices in use. Please refer to our Mobile Setup guide for Android and iOS for detailed instructions.
![Katalon Studio 20 - How to do Mobile (android) Testing on Windows with Katalon Studio | 8 STEPS Katalon Studio 20 - How to do Mobile (android) Testing on Windows with Katalon Studio | 8 STEPS](https://i.ytimg.com/vi/qsFXyUNiQFg/hqdefault.jpg)
Run your mobile automation test case on Kobiton cloud devices
1. Upload the Material Login Demo app to Kobiton App Repository. From the Repository view, select the more actions button and select the Automation snippet. Copy the app id (the one in bold, for example, Kobiton-store:184 as shown below) and save it.
2. Navigate to the Kobiton Devices page. Choose the devices on which you want to run your test and mark those devices as a favorite by clicking on the star icon. 3. Let’s enable Kobiton integration.
- Open Katalon Studio Preferences ( Windows -> Katalon Studio Preferences ) then select Kobiton .
- Enter your Kobiton username and password. Click Connect to test the connection and authentication. With a valid account, Katalon Studio automatically retrieves the API keys from Kobiton.
- Click Apply or OK to save the settings.
4. Open the test case created from the previous section, replace the input application path for the first step ” Start Application” with the Kobiton app id saved in Step 1.
5. A new menu option appears under the Execution toolbar as below. Click on Kobiton Device to open the Kobiton Favorite Device dialog.
6. Select your target device for execution from the Kobiton Favorite Device list. Click OK to start execution with that device. It may take some time to initialize the connection to Kobiton prior to the execution. You should be able to login to Kobiton sessions to view the result once the test execution completed.
The combination of Katalon Studio and Kobiton empowers automation engineers in validating the quality of mobile apps by allowing them to execute recorded test cases on hundreds of devices quickly. This solution does not only save them time but also maximizes test coverage. Katalon Studio is a FREE – a full-featured automation solution that can be downloaded at www.katalon.com. Kobiton is a cloud-based mobile device farm that provides real devices for both manual and automation testing with an affordable price. You can register a Kobiton account for free trial.
For more details, please visit Katalon Studio Resources Center.
Efficient and Seamless Mobile Test Automation with Katalon
Mobile test automation has become a crucial aspect of software testing due to the increasing popularity of mobile devices. However, the lack of simple and focused toolsets has resulted in a gap in the availability of effective mobile test automation skills in the industry.
This blog discusses the benefits of using Katalon for mobile test automation, which offers a seamless transition with minimal interruptions, everything needed to get started in one platform, practical scalability and maintenance, and cloud-based test executions.
Challenges in Mobile Test Automation
There are several challenges in mobile test automation, and the most common theme that is highly inefficient and error-prone is maintaining separate test scripts and object locators for test automation coverage across different platforms. This approach not only hinders test automation productivity but also introduces unnecessary complexities, making it challenging to ensure consistent application quality. In the world of rapid software development, where mobile applications are constantly evolving, the need for agile and sustainable testing methodologies is paramount.
![Katalon Studio Demo for Mobile Automation Katalon Studio Demo for Mobile Automation](https://i.ytimg.com/vi/N7MpdYQZD3o/hqdefault.jpg)
Why Katalon for Mobile Testing Automation
Simple setup
Bundled with required components and prebuilt keywords to start your mobile automation project in no time.
Appium-compliant
Support the latest mobile platforms and devices. Leverage the Appium-based rich and active ecosystem.
Powerful object spying utility
Effectively detect and store UI elements to speed up the scripting process and reduce maintenance effort.
Robust recording utility
Effortlessly generate tests with mobile recorder.Automatically store all UI elements for reuse purposes.
Automatically store all UI elements for reuse purposes.
Optimal cross-functional testing
Maximize automation efficiency with reusable test objects and scripts across API, web, and mobile platforms.
Cross-environment execution
Tests can be executed locally and remotely with real devices, simulators or cloud-based devices.
Cloud-based mobile platform integration
Integrate with the mobile platforms you are already using (Sauce Labs, LambdaTest, and more).
Benefits of Katalon for Mobile Test Automation
Katalon offers everything needed to get started in one platform, including dependencies and tools, without the technical know-how. Its approach is similar to web automation, with keywords, test data, folders, and integrations. Katalon allows testers to automate native, hybrid, or mobile web applications, making it a versatile tool for mobile test automation.
Katalon also offers practical scalability and maintenance, as the same scripts and object locators can be used across iOS and Android. Its visual testing feature allows for keyword-based AI without the hype, enabling testers to easily verify layout and content. Additionally, Katalon’s cloud-based capabilities (TestOps, TestCloud) provide scheduling, executions, and reports, allowing testers to easily manage and execute their tests on remote servers.
![Mobile Salesforce Testing with Katalon: Setting up emulator in Android Studio Mobile Salesforce Testing with Katalon: Setting up emulator in Android Studio](https://i.ytimg.com/vi/-HgRpbGyZEE/hqdefault.jpg)
Types of Mobile Applications
There are three basic types of mobile apps that require different software to develop. While you may approach each of these differently, they all require mobile testing.
Native Apps (iOS/Android)
Native apps are created specifically for iOS or Android. Since they are designed for one particular operating system, they run more quickly and smoothly. Native apps make use of different device resources such as GPS, camera, device storage, etc.
Web Apps
Web apps can be accessed from any mobile device because they are delivered through a native browser such as Chrome or Safari. Popular web apps include emails, instant messaging apps, and weblogs.
Hybrid Apps
Hybrid apps run through a web browser and can be downloaded on a mobile device. Just like web apps, they are developed through HTML5 and JavaScript. Hybrid apps can be installed from the app store or have their own icon.
Create and Run your first Android test case in Katalon Studio
Create a new project
-
In the Test Explorer on the sidebar > click New Project.
-
In the displayed New Project dialog:
- Input project Name.
- In project Type, select Mobile.
- In Project, select Sample Android…, the Repository URL is filled automatically.
-
Browse a Location to store your project, then click OK.
Record a test case
-
On the main toolbar, click Record Mobile > select Android Devices.
-
In the displayed Mobile Recorder dialog, specify the information at the Configurations section:
- Device Name: select one of your connected Android devices.
- Start with: Select Application File in the drop-down list.
- Application File: Browse APIDemos.apk.
-
Click Start to begin recording your test case:
- Wait until the AUT is launched.
- The Device View and All Objects are ready for you to interact with the application.
-
On the Device View > click OS, Katalon Studio selects OS in All Objects correspondingly.
-
Once OS is selected, Tap is enabled in Available Actions > click Tab, the tap action is performed as follows:
- The Device View is rendered with newly displayed elements.
-
In Recorded Actions, Tap is added to the list of recorded steps.
-
In Captured Objects, OS is captured with its properties.
Note:
- The essential property of an object is its locator strategy and value. The default locator is a unique value in detecting that object.
- If you prefer another locator strategy, select your preferred one and generate a new locator > click Highlight to see if your newly updated locator can detect the target object on its screen correctly.
-
Similarly in Device View, click SMS Messaging > click Tap in Available Actions.
You can see another tap action is added to the list of Recorded Actions and Captured Objects.
-
In Device View, select the text input area right next to Recipient > click Set Text in Available Actions.
In the displayed Text Input dialog, enter a phone number > click OK. You can see a phone number is filled in the text field in Device View.
-
In Device View, select the text input area next to the Message Body > click Set Text in Available Actions.
In the displayed Text Input dialog, enter any message > click OK.
You can see the message is set in the text field in Device View and the Set Text is added to the Recorded Actions.
-
In Device View, click Send > click Tap in Available Actions.
Note:
- If you launch the APIDemos.apk application on a real device with a carrier, the message can be sent successfully.
-
Click on the Stop button above the CONFIGURATIONS section to close the application and finish recording.
After finishing recording the desired interactions with the AUT, click Save script to save the captured objects.
In the displayed Folder Browser dialog, create a new folder or select an existing folder in Object Repository > click OK.
-
You can add the recorded test steps to a new test case, append to or overwrite an existing one.
Note:
- Appium known limitation: You may get incorrect object highlighting when rotating the device to landscape view.
- Workaround: After rotating, you need to click on the Capture Object button to refresh the All Objects tree, then the highlighting will work normally.
Playback a test case
To playback the recorded scenario:
- Select the test case where you saved the recorded actions.
-
On the main toolbar, select Android device on the drop-down list next to Run.
-
In the displayed Android Devices dialog, select a device > click OK.
Katalon Studio executes the mobile test with the recorded steps accordingly.
View the test case in Script mode.
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.configuration.RunConfigurationimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobileimport com.kms.katalon.core.model.FailureHandling as FailureHandling’Start the Application’Mobile.startApplication(RunConfiguration.getProjectDir() + ‘/APIDemos.apk’, true)’Tap on OK if this is the first time this application is launched on an Android 9+ device’Mobile.tap(findTestObject(‘Object Repository/APIDemo/android.widget.Button – OK’), 0, FailureHandling.OPTIONAL)’Tap on text “OS”‘Mobile.tap(findTestObject(‘Object Repository/APIDemo/android.widget.TextView – OS’), 0)’Tap on text “SMS Messaging”‘Mobile.tap(findTestObject(‘Object Repository/APIDemo/android.widget.TextView – SMS Messaging’), 0)’Enter a phone number in Recipient text box’Mobile.setText(findTestObject(‘Object Repository/APIDemo/android.widget.EditText’), ‘+84345678910’, 0)’Enter a message in Body Message text box’Mobile.setText(findTestObject(‘Object Repository/APIDemo/android.widget.EditText (1)’), ‘Hello world! This is Katalon Mobile Recorder’, 0)’Send the message’Mobile.tap(findTestObject(‘Object Repository/APIDemo/android.widget.Button – Send’), 0)’Close the Application’Mobile.closeApplication()
Next: Execute and Debug a Test Case.
Previous: Set up Android-mobile-tests.
Best Practices of Mobile Test Automation for Cross-Platform Testing with Katalon Studio
Mobile test automation is an essential part of the software development process. With the growing number of mobile applications for both iOS and Android platforms, it has become imperative for organizations to ensure the quality and functionality of their apps across these two major platforms.
This article explores the best practices for mobile test automation using Katalon Studio, a powerful mobile test automation tool, with a focus on enabling the same test scripts and object locator strategies to be used for testing both iOS and Android applications.
![Katalon Studio Automation Beginners Full Course | Learn Katalon Studio in 6 Hours | Katalon Studio Automation Beginners Full Course | Learn Katalon Studio in 6 Hours |](https://i.ytimg.com/vi/rzp-VTkW9Vc/hqdefault.jpg)
Create mobile automation test cases using Katalon Studio recording utility
Before starting, make sure that you have:
- Downloaded the target app under test – Material Login Demo. This app provides a set of simple authentication features that will be automated as demonstrated below.
- Configured your Katalon Studio instance for mobile testing.
Katalon Studio provides two utilities to accelerate the automation process: Mobile Object Spy to quickly populate the project’s object repository and Mobile Recorder to generate automation scripts from recorded actions. As this tutorial mainly focuses on the functionalities of the Recorder utility, for more details, please refer to the Object Spy user guide available from Katalon Studio Documentation on how to use this utility.
1. Let’s open the sample project (already included in Katalon Studio) and create a new test case. Click on the Mobile Recorder button to open its dialog as shown below
Where
Section | Explanation |
Device View | Device inspector view. Preview of device UI will be displayed here. Click on any elements to select. |
Configurations | Select setting for recording session |
All Objects | The current mobile elements hierarchy on the device. Click to select an element and view its properties in Object Properties. |
Possible Actions | All available actions that can be performed on the device |
Object Properties | All properties of the selected element in All Objects. |
Recorded Actions | All recorded actions appear here |
2. With the dialog opened, follow the following steps to configure your recording session:
- Plug in your device or start your emulator then select it from the Device Name combo box.
- Click Browse… to select the app file from your computer (.apk for Android, .ipa for iOS apps)
- Click Start and wait for the app to launch on your device.
Once the configuration is completed, the app appears as shown in the screenshot above. (Note: starting the app is registered as the first recorded action.)
3. With your app ready on your mobile device, start recording the test case.
- Tap on “No account yet? Create one” to navigate to the Create Account Select the android.widget.TextView0 object in the all objects tree. (Or you can tap the text on the Device view to focus on the object).
- Then click the Tap button to record the action. This action simulates a tap on the app.
You will be directed to the Create Account screen.
- Fill in the information to create an account.
Select android.widget.EditText0 (or tap on the Name text box on the Device view to fill in name). Then click Set Text to perform the set text action on the Name text.
Enter “name” for the text input as below. Click OK.
The text is set to the device, and the action is recorded in the Recorded actions table.
- Perform the same steps with the Address field, and enter “address” for this field.
- To enter the value for the Email field, we will need to hide the on-screen keyboard to make the field visible by pressing the Hide Keyboard action button. Select the Email field to perform the set text action using “[email protected]” .
- Follow the same steps for the Mobile Number, Password and Re-enter Password text fields.
- Finally, click on Tap to tap on the Create Account. You will be redirected to the main screen.
- Click Stop on the Mobile Recorder dialog to stop the recording.
The recorded actions should look like the following:
- Click OK to complete the recording and then choose a folder to store your captured objects. Click OK again for Katalon Studio to generate test scripts.
4. View your test case in the Manual mode or replay it to validate all recorded steps. Let’s now add validation points for this test case to verify whether the recorded inputs can set to the text fields successfully.
- Select the first Set Text _from the Add toolbar or by clicking on Add from the context menu, add a Mobile Keyword step and choose the keyword Verify Element Attribute Value._
- Select the test object representing the Name text field, which is widget.EditText0, as an object to verify.
- Double click on the input cell for the test step and set the following values.
- Perform the same procedure for other Set Text actions.
After adding the validation test steps, try to run the test case again. This time the execution takes longer for Katalon Studio to perform the validation steps, but your test case should pass successfully since the input value is identical to the validation value. You can test with different values or connect to a data source.
Why Cross-Platform Testing?
Cross-platform testing is a vital component of mobile test automation because it allows organizations to ensure consistent user experiences on both iOS and Android devices. By employing the same test scripts and object locators, teams can streamline their testing efforts and reduce maintenance overhead. This approach significantly improves the efficiency of the testing process.
![Katalon Studio for Complete Beginners | Step by Step Masterclass Part 1 Katalon Studio for Complete Beginners | Step by Step Masterclass Part 1](https://i.ytimg.com/vi/lcUgrciUCPg/hqdefault.jpg)
Setting Up Katalon Studio for Mobile Test Automation
Before we delve into the best practices for cross-platform testing with Katalon Studio, it’s essential to ensure your environment is set up correctly. Follow these steps to get started:
Install Katalon Studio
Make sure you have Katalon Studio installed on your machine. You can download the latest version from the Katalon website.
Install Required Mobile Automation Libraries & Drivers
Download and install the required libraries such as Appium (2.X) for mobile automation, and the necessary drivers for iOS (XCUITest) and Android (UIAutomator2). You’ll need Xcode for iOS testing and Android Studio for Android testing. Make sure these tools are properly installed and configured.
How to Do Mobile Testing
Learning how to do mobile testing will help you develop a five-star rated app. Follow these steps to create a successful mobile testing strategy.
Decide Your Devices
The first step in your mobile test strategy should be deciding what device to test your mobile app on. Choose real devices with different OS and screen resolutions to receive accurate testing results.
Decide Between Emulators or Simulators
Since mobile testing on real devices can be expensive and time-consuming, you have the option to test on two virtual devices — a simulator and an emulator.
A mobile simulator imitates the software on your system that was designed for mobile and lets you run programs not made for your OS. Emulators, such as an android mobile emulator, are exactly the same but include the hardware of your mobile as well.
Emulators are more suitable for debugging, but binary translation makes them slow. Simulators are not as reliable for debugging purposes, but they work faster as there is no binary translation. With emulators, you can’t modify your apps, and simulators allow you to set up identical environments to the original device’s OS.
Therefore, simulators are better for mobile testing, and emulators are better for mobile site testing. However, the best way to receive the most accurate results is to use real devices over virtual devices.
Understand Tools
The next step in your mobile test app strategy is to clearly understand the tools that will translate your tests into actions. This will make you more efficient and give you more confidence during testing.
While you can build your own testing frameworks to improve efficiency, increase test speed, and reduce maintenance costs, vendor-based tools allow you to meet growing demands at a faster rate and get feedback quicker. Vendor-based tools already have built-in features to help anyone run a test, despite their level of technological knowledge.
Plus, it can be difficult to choose and set up your own testing framework, but vendor tools have a faster learning curve and make it easier to get started with automation. With vendor-based tools, you can reach customer service 24/7 so you can solve any issue at any time.
Document Throughout the Entire Process
Documentation is key for creating a perfect mobile test strategy. If you don’t document from start to finish, you risk wasting your time and creating problems in the future. No matter how small, you need to document every decision as it can help train employees and help solve issues.
![What is API testing? | API Testing Using Katalon Studio | Software Certification Training | Edureka What is API testing? | API Testing Using Katalon Studio | Software Certification Training | Edureka](https://i.ytimg.com/vi/5qSoeAomkLA/hqdefault.jpg)
Anatomy of a Java-Appium homegrown solution
A Java based Appium test automation solution consists of several components that work together to provide a comprehensive solution for testing mobile applications.
These components include configuration management, test framework, page objects, page actions, test cases, test data, and reporting. When building your own solution, each of these components must be imported, configured, adopted and applied by the team. Remember, this is in addition to conducting any test automation!
Configuration Management
The configuration management component is responsible for managing the configuration of the test environment. It includes properties files, environment variables, and system properties. The configuration management helps to keep the test code flexible and easily configurable.
Test Framework
The test framework is responsible for providing the infrastructure to run the tests. It includes libraries such as Appium for mobile automation, TestNG or JUnit for test management, and Maven or Gradle for build and dependency management.
Page Objects
Page objects are Java classes that represent the various pages of the application. Each page object encapsulates the behavior of the page and provides methods that can be used to interact with the page. The page objects help to keep the test code modular and easy to maintain.
Page Actions
Page actions are Java classes that represent the various actions that can be performed on the pages of the application. Each page action encapsulates the logic to perform a specific action on a page. For example, clicking a button, entering text in a field, etc.
Test Cases
Test cases are the core of any test automation framework. They define the steps that need to be executed to verify the expected behavior of the application under test. Test cases are typically written in a human-readable format and can be easily maintained over time.
Test Data
Test data is the input that is provided to the test cases. It can be stored in various formats such as CSV, Excel, or JSON files. Test data is used to test the application with different input combinations and ensure that the application behaves correctly under various conditions.
Reporting
The reporting component provides a summary of the test execution results. It generates reports in various formats such as HTML, XML, or PDF. The reports help to identify the tests that have passed or failed and provide details on the root cause of any failures.
What is MobileApplication Testing?
Mobile application (app) testing is the process of verifying whether an app designed for handheld devices meets certain mobile testing requirements. “Mobile app” refers to three types of software: native apps, mobile web apps, and hybrid apps.
In all software development processes, mobile app testing is a must before an app is released into the marketplace. This step ensures the final product functions properly throughout its customer experience journey.
Mobile testing not only oversees the quality and functionality of the app but also effectively increases user engagement.
![Belajar Web Testing Menggunakan Katalon Studio | Automation Testing untuk Pemula Belajar Web Testing Menggunakan Katalon Studio | Automation Testing untuk Pemula](https://i.ytimg.com/vi/CtcsvswG7_o/hqdefault.jpg)
In conclusion
Mobile test automation is crucial for ensuring the quality of software geared towards mobile devices. Katalon offers a seamless transition for testers with experience in web automation, everything needed to get started in one platform, practical scalability and maintenance, and cloud-based test executions. Its versatility and ease of use make it an efficient tool for mobile test automation, addressing the potential gap in the availability of effective mobile test automation skills in the industry.
Tạo dự án Mobile Testing với Katalon Studio và tích hợp Kobiton cloud-based device farm
Bài đăng này đã không được cập nhật trong 4 năm
Chúng ta đã cùng nhau tìm hiểu về Katalon Studio qua loạt bài Automation test – Katalon. Trong bài viết này, chúng ta sẽ nghiên cứu một khả năng các của Katalon Studio đó chính là Mobile Testing, cách làm thế nào để tăng tốc cho dự án test automation và chạy testcase của bạn trên hàng trăm thiết bị của Kabiton trên cloud. Chúng ta sẽ mặc định rằng bạn đã có kiến thức cơ bản và đầy đủ môi trường để phát triển bao gồm:
- Katalon Studio
- Node JS
- Appium
- Kobiton
Tạo testcase automation test cho mobile sử dụng Katalon Studio Recording
Cài đặt app
- Tải app mẫu test – Material Login Demo.
- App này cung cấp cơ chế login đơn giản để chúng ta có thể tạo test.
Viết testcase đầu tiên
Katalon Studio cung cấp hai tool để tăng tốc viết automation test: Mobile Object Spy để nhanh chóng tìm ra các object trong dự án và Mobile Recorder để sinh ra mã automation từ những hành động đã record. Như bài hướng dẫn này sẽ tập trung vào tính năng Recorder, nếu cần, bạn vẫn có thể tham khảo thêm Object Spy ở Katalon Studio Documentation.
- Đầu tiên chúng ta sẽ tạo mới dự án, nhớ rằng chọn Type là “Mobile”, điều này sẽ giúp Katalon cấu hình cho dự án có thể test ở chế độ mobile
- Sau khi đã tạo dự án và vào giao diện chính, hãy tạo một test case mới.
-
Click vào Mobile Recorder button để mở cửa sổ sau
- Ở mục Device type để có thể có thể liên kết với device của Kobiton, chúng ta phải chọn là “Kobiton devices”
- Ở mục Device name, hãy chú ý, nhiều bạn sau khi kết nối với Kobiton thì không thể load được device, điều này có thể giải quyết bằng cách hay vào account Kobiton và chọn những device bạn muốn test là Favorite, điều này sẽ giúp Katalon lấy được những device mà bạn muốn test với nó
- Sau khi hoàn thành, hãy chọn Start để bắt đầu quá trình record
- Nếu kết nối thành công thì bạn sẽ thấy giao diện của Katalon sẽ như bên dưới. Tại đây chúng ta có thể thấy được tất cả các UI trên test app ở mục “All Objects”
- Cửa sổ “Device view” sẽ cho phép chúng ta thao tác với device giống như ta đang sử dụng các máy ảo, việc này rất dễ dàng
- Bước tiếp theo hãy chọn “No account yet? Create one” để tạo một account trong test app, việc click sẽ được Katalon record lại thành action tap vào UI, bạn không cần phải thực hiện thủ công tại bước này.
- Nhập đầy đủ các thông tin, tại đây, mỗi khi click vào một textbox, Katalon sẽ cho ta chọn action thực hiện với textbox đó để record lại step, hãy chọn “Set text”
- Sau khi đã hoàn thành, hãy chọn “Create account” để hoàn thành việc record.
- Sau khi đã hoàn thành bước record, chúng ta sẽ thực hiện việc chạy lại test case vừa được record, hãy xem thành quả nhé.
- Và đây là kết quả, bạn đã hoàn thành một testcase một cách đơn giản, Katalon sẽ report lại cho chúng ta thông tin testcase đã chạy như vậy
- Hãy tiếp tục với testcase tiếp theo nhé, và đây là “Login”
Đây là Video mình làm nhé: https://drive.google.com/file/d/1JOZb_mv5Nr8ABE65QC5efZXdVbNSIu24/view
Tổng kết
-
Qua ví dụ trên:
- Chúng ta đã tìm hiểu được thế nào để thực hiện một dự án đơn giản với automation mobile
- Làm thế nào để tích hợp Kobiton (Cloud farm device), để việc chạy testcase chưa bao giờ nhẹ nhàng đến thế, nhất là với các bạn tester chưa có device test hoặc không thể cài được máy ảo
- Mong rằng qua ví dụ trên sẽ giúp các bạn mới bước chân vào nghề tester hoặc làm quen với mobile testing một cách dễ dàng nhất.
Tham khảo
All rights reserved
Testing Web App on Mobile Browsers in Katalon Studio
Katalon Studio supports executing the same test cases on both desktop browsers and mobile browsers. A test case created via recording, either in manual mode or script mode, on a desktop browser with Katalon Studio can be executed on a mobile browser as well. This tutorial guides you step by step how to do that.
- Understand your web application under test (AUT)
- Create a test case with Katalon Studio
- Execute the test case with mobile browsers
Troubleshoot common errors
1. ChromeDriver related error
error: No Chromedriver found that can automate Chrome '
To fix this, you have to download ChromeDriver for Appium manually. You can download the ChromeDriver for Appium from this Github repository: ChromeDriver. By default, the npm package
appium-chromdriver
comes bundled with the latest version of ChromeDriver. Replace the existing ChromeDriver in Appium Directory with the newly downloaded one.
-
macOS: go to
/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver
-
Windows: go to
C:\Users\
\AppData\Roaming\npm\node_modules\appium\node_modules\appium-chromedriver
2. W3C mode related error
Caused by: org.openqa.selenium.UnsupportedCommandException: unknown command: Cannot call non W3C standard command while in W3C mode
This error is fixed in Katalon Studio version 7.1.0+. Please upgrade for the improvement. Alternatively, you can see a workaround in Katalon forum, click here.
[Mobile] Create and Run Android Test Case
This tutorial demonstrates how to create Android tests with Katalon Studio using Record and Playback.
Go through the following “Recording a scenario of sending a message via the APIDemos.apk application” to get familiar with these features. The basic steps are:
- Launch APIDemos.apk on the device.
- Tap on OS.
- Tap on SMS Messaging.
- Enter a phone number and a message.
- Tap on Send.
- APIDemos.apk and sample project code are available here.
![Katalon Studio – A Quick Introduction Katalon Studio – A Quick Introduction](https://i.ytimg.com/vi/prfWU7JGWhU/hqdefault.jpg)
Conclusion
Mobile test automation is a crucial aspect of ensuring the quality of mobile applications on both iOS and Android platforms. Using Katalon Studio for cross-platform testing allows you to streamline your testing efforts and improve the efficiency of your testing process. By following the best practices outlined in this article, you can create a robust, maintainable, and efficient mobile test automation framework that works seamlessly on both iOS and Android devices. Embrace these practices to save time, reduces the risk of errors, and ensure that your tests consistently perform across different mobile platforms.
The Ultimate Mobile Testing Guide
Have you ever used an app on your mobile device and experienced slow load times, crashes, freezing screens, and privacy breaches? Or has your team discovered an error in an existing functionality weeks after you’ve launched an app? If you are a mobile app user, the answer is likely yes.
As a consumer, you may have been triggered to delete the app completely, reinstall it, or download a competitor’s app. As the mobile app developer, you have possibly lost customers and damaged your reputation.
So why does this happen? The answer is simple — mobile testing has not taken place.
According to Statista, there were 230 billion mobile app downloads in 2021, surpassing 200 billion in 2019. The mobile app market is growing at a rapid rate, and mobile apps play a vital role in our everyday lives. That is why conducting a mobile test is so crucial for company success.
In this guide, we will outline what mobile testing is, how to do mobile testing, and what you need to conquer it.
![Codeless automation Testing Tools | Script less automation Tools | Automation Tester without Coding Codeless automation Testing Tools | Script less automation Tools | Automation Tester without Coding](https://i.ytimg.com/vi/3Nd1cRrld4M/hqdefault.jpg)
What is Mobile Testing?
Mobile app testing is the process of testing an app to ensure it is functioning properly and provides a smooth and enjoyable user experience. This can be done manually or with mobile test automation tools.
Mobile testing is key to designing a high-quality product that stands out from the rest. Before releasing an app to the market, every company must verify it is accessible, reliable, consistent, and user friendly.
You can’t expect an app to be successful without mobile testing. It guarantees an app is ready to launch and of excellent quality.
Challenges in Mobile Test Automation
There are several challenges in mobile test automation, and the most common theme is the lack of simple and focused toolsets that can encourage the transitory adoption of mobile automation for WebUI automation testers. Mobile testing requires its own set of additional test scenarios, and it is perceived as a difficult skill to master.
Additionally, the use of Appium, the most popular tool for mobile test automation, requires a level of Software Engineering knowledge that may not be widely available. Testers need to spend a considerable amount of time and effort in setting up and configuring the Appium server and defining the mobile automation framework.
![Testing Android Applications With Appium | Appium Tutorial For Mobile Testing | Edureka Testing Android Applications With Appium | Appium Tutorial For Mobile Testing | Edureka](https://i.ytimg.com/vi/i1tQ1pjEFWw/hqdefault.jpg)
Understand your web application under test (AUT)
When a smartphone is a must-have for everyone, it is required for a web application to accommodate both desktop browsers and mobile browsers.
Often, a desktop UI and a mobile web UI will vary for the same web application since the screen of a desktop is different from that of a phone (in resolution, size, and ratio, for example). Thus, a web application with responsive implementation can adapt to various devices, which might cause a problem during the quality assurance period. The same element on desktop implementation may have different locators on mobile, preventing test cases from executing correctly on mobile browsers.
Do not stress out when your test cases cannot run properly on mobile browsers like desktop browsers. Automation testing is about understanding the AUT (Application Under Test) clearly to find a suitable approach. This practice should be a top priority before we want to continue testing our web application.
Create a test case with Katalon Studio
After understanding your AUT, and you have decided to perform automation testing, let’s create a test case with Katalon Studio. Below is the test scenario and how to create the test case in manual mode.
Scenario: Login
Step 1: Launch Chrome browser on mobile.
Step 2: Enter valid username and password.
Step 3: Click on the login button.
Step 4: Verify login is successful.
Manual Mode
Step 1: Click on Add from Toolbar and select Web UI Keyword.
Step 2: Select Open Browser and pass the URL in the input field. Call Wait for Page to Load and provide a timeout value in the input field.
Step 3: Add Wait for Element Visible keyword for button object “Make Appointment.”
Step 4: Before performing the click action, Verify whether the element is clickable using Verify Element Clickable keyword, pass the object button “Make Appointment.”
Step 5: Call Click action to be performed on the “Make Appointment” button.
Step 6: Wait for Element Visible “Login.”
Step 7: Add Verify Element Clickable and pass the object as the “Login” button.
Step 8: Set Text for the username as “John Doe”.
Step 9: Set Text in the password as “ThisIsNotAPassword”.
Step 10: Add Click action to be performed on the Login button.
Step 11: Wait for Element present of text “Make Appointment”.
Step12: Add Get Text keyword to capture the Header “Make Appointment” and store it in a variable called “actual_Header”.
Step 13: Use the Verify Match Keyword to verify the actual and expected texts.
Step 14: Close the browser.
You can also achieve the desired test case by using Script Mode.
Script Mode
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.model.FailureHandling as FailureHandlingimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI’Launch Browser’WebUI.openBrowser(‘http://demoaut.katalon.com/’)’Wait for Page Load’WebUI.waitForPageLoad(30)’Wait for Element Visible of Button Make Appointment’WebUI.waitForElementVisible(findTestObject(‘Browser Application/button_Make Appointment’), 30)’Verify Button Make Appointment is clickable or not’WebUI.verifyElementClickable(findTestObject(‘Browser Application/button_Make Appointment’), FailureHandling.STOP_ON_FAILURE)’Click on Button Make Appointment’WebUI.click(findTestObject(‘Browser Application/button_Make Appointment’))’Wait for text login Header ‘WebUI.waitForElementVisible(findTestObject(‘Browser Application/text_Login Header’), 30)’Verify text login Header is in visible ‘WebUI.verifyElementVisible(findTestObject(‘Browser Application/text_Login Header’))’Enter username as “John Doe”‘WebUI.setText(findTestObject(‘Browser Application/txt_UserName’), ‘John Doe’)’Enter password as “ThisIsNotAPassword”‘WebUI.setText(findTestObject(‘Browser Application/txt_Password’), ‘ThisIsNotAPassword’)’Click on Login Button’WebUI.click(findTestObject(‘Browser Application/button_Login’))’Wait for Element Present of “Header Make Appointment”‘WebUI.waitForElementPresent(findTestObject(‘Browser Application/text_Header Make Appointment’), 30)’Get the Header text of Make Appointment and store in “actual_Header” variable’actual_Header = WebUI.getText(findTestObject(‘Browser Application/text_Header Make Appointment’))’Verify the actual and Expected text’WebUI.verifyMatch(actual_Header, ‘Make Appointment’, false)’Close the Browser’WebUI.closeBrowser()
Do not forget to execute the test case in Katalon Studio again to ensure that it works properly.
![Katalon Studio Tutorial Part 1 - Setup, Install and Run Script using Katalon Katalon Studio Tutorial Part 1 - Setup, Install and Run Script using Katalon](https://i.ytimg.com/vi/6hh8Lx2P39g/hqdefault.jpg)
Mobile Testing with the Katalon Platform
The Katalon platform makes software testing more efficient and simpler. We are an end-to-end quality platform that provides automation testing on multiple domains such as web, API, mobile app, and desktop.
Let’s discover what Katalon offers to help you seamlessly get started with your mobile testing for Android and iOS apps.
Mobile Testing
The quality of a mobile application affects its sustainability in the market. The question is, how can app providers build high-quality products that stand out among the rest? The answer is with testing.
What is mobile testing?
Types of mobile testing
Mobile testing best practices
Katalon for mobile testing
Katalon Mobile Application Testing Capabilities
Mobile Testing Capability
Katalon Studio
Supported OS
Installation & Use
Application Under Test
Testing Platform
Testing Device
Programming Skill
Record & Playback
Platform
Test Management
Katalon TestOps
Reporting & Analytics
Katalon TestOps
Applied Artificial Intelligence
AI Visual Testing
Test Execution
Katalon TestCloudKatalon Runtime Engine
Testing Mobile Apps using Katalon Studio and Kobiton cloud-based device farm
Scripting your first mobile automation test case can be quite confusing without a specialized tool or instruction. In this tutorial, we will show you how to speed up your automation project using Katalon Studio’s mobile recording utility and run your recorded test cases on hundreds of Kobiton’s mobile devices on the cloud. For this tutorial, we assume that you have already installed Katalon Studio, got familiar with its basic functions and registered a Kobiton account.
![Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Testing Tutorial | Edureka Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Testing Tutorial | Edureka](https://i.ytimg.com/vi/5FUdrBq-WFo/hqdefault.jpg)
Types of Mobile Application Testing
Functional mobile app testing
Often applied to test UI elements, screen adaptation, core structures, and functions of the app. It also tests the installation and update processes, localization settings, compatibility, and accessibility of the application under test (AUT).
Operational mobile app testing
Operational testing assesses the AUT’s response to events and changes in certain devices such as power cycling, data cable connection, Wi-Fi connection, and airplane mode status; then compare them with the defined requirements.
Interrupt mobile app testing
Interrupt tests imitate all possible interruptions, such as incoming and outgoing calls/SMS/MMS, pop-up notifications/reminders, etc. They ensure the AUT can handle all interruptions by going into a suspended state and restarting afterward.
Mobile app security testing
Ensures the AUT’s absolute security over the users’ data to avoid risks such as leakage of sensitive information. Security tests will put the AUT’s data and network security under adequate tests to meet the security requirements.
Mobile app performance testing
Determines how the application responds under a particular number of challenges such as low battery power, out-of-coverage network, etc. In general, performance testing will test the speed, stability, and scalability of the application.
Mobile app regression testing
Verifies whether or not the latest updates or patches introduce new regressions, or bugs, into the mobile app system. It is done continuously to ensure that new changes are feature improvements, not defects to the application.
What Are the Best Tools to Use for Mobile Testing?
There are several affordable mobile testing tools to choose from, but the fastest and most efficient are mobile test automation tools. Here are the advantages of using mobile test automation:
- Scalable for larger apps
- More cost-efficient
- Can perform multiple tests at once
- Executes difficult tasks that manual testers can’t perform
Building your own in-house framework means using open-source testing libraries or SDKs such as Selenium WebDriver, Cypress, Espresso, XCUITest, EarlGrey, Rest Assured, K6, etc. This requires a high level of experience and additional time, whereas a pre-built tool is ready for you to use and accessible when you need it.
Open-source libraries are designed to build automated testing tools, so using a pre-built tool will save you time and effort and allow you to run tests quickly and easily.
Here are some of the best mobile test automation tools for effective iOS and Android app testing:
- Katalon: Built on top of Appium and Selenium, Katalon is a ready-to-use vendor-based tool and ready-made test automation platform for mobile, web, API and desktop (Windows) apps. Katalon is easy-to-use and best for users without the dev resources to build and maintain a mobile testing framework from scratch.
- Appium: Appium is the most popular testing framework that can be used on both native and hybrid apps. This tool supports multiple languages and can do cross-platform development.
- XCUI Test: XCUI Test supports iOS apps and allows testers to record the process instead of writing the codes.
- Robotium: Robotium supports Android apps and can be used on native and hybrid apps and has simple test scripts.
![Katalon Automation Lesson 03 - First Automation Test | Record & Replay (2022) Katalon Automation Lesson 03 - First Automation Test | Record & Replay (2022)](https://i.ytimg.com/vi/Dg5A5Wg2gXs/hqdefault.jpg)
Why is mobile applicationtesting important?
Imagine yourself – as a user – trying out a new app. If the app takes too long to download, chances are you might exit before even using it.
If it functions well on Android but the UI is funky on your iOS devices, you may also drop out. If the app repeatedly crashes while in use, you may discontinue using it.
So thoroughly testing your app would eliminate risks like these and increase the app retention rate.
Keywords searched by users: katalon studio mobile automation
Categories: Chia sẻ 96 Katalon Studio Mobile Automation
![Efficient and Seamless Mobile Test Automation with Katalon Efficient And Seamless Mobile Test Automation With Katalon](https://cms-cdn.katalon.com/efficient_and_seamless_mobile_test_automation_with_katalon_social_post_3393e674be.png)
![10 Best Mobile Testing Tools | Latest 2024 Updated 10 Best Mobile Testing Tools | Latest 2024 Updated](https://cms-cdn.katalon.com/Feature_Img_219c52c87b.png)
![Katalon Studio 22 - How to do iOS (mobile) testing | 10 STEPS - YouTube Katalon Studio 22 - How To Do Ios (Mobile) Testing | 10 Steps - Youtube](https://i.ytimg.com/vi/73hgLeIBrgA/maxresdefault.jpg)
![Katalon Studio Mobile Automation Testing | Software Testing Material Katalon Studio Mobile Automation Testing | Software Testing Material](https://www.softwaretestingmaterial.com/wp-content/uploads/2017/06/katalon-studio-mobile-automation-14.png)
![Katalon Automation Lesson 14 - Mobile (Android) Automation |Appium| Mobile Automation Test| NodeJS - YouTube Katalon Automation Lesson 14 - Mobile (Android) Automation |Appium| Mobile Automation Test| Nodejs - Youtube](https://i.ytimg.com/vi/1dl9gonSIIY/maxresdefault.jpg)
![Katalon Studio Mobile Automation Testing | Software Testing Material Katalon Studio Mobile Automation Testing | Software Testing Material](https://www.softwaretestingmaterial.com/wp-content/uploads/2017/06/Katalon-Mobile-Automation.webp)
![Part 1 - Introduction and getting started with Katalon studio for Android Automation - YouTube Part 1 - Introduction And Getting Started With Katalon Studio For Android Automation - Youtube](https://i.ytimg.com/vi/ej_xay0acDY/maxresdefault.jpg)
![Simplify Mobile Test Automation with Katalon TestCloud Simplify Mobile Test Automation With Katalon Testcloud](https://cms-cdn.katalon.com/Feature_img_in_web_a2ac468b96.png)
![A Detailed Guide On Using Katalon Studio With HeadSpin A Detailed Guide On Using Katalon Studio With Headspin](https://assets-global.website-files.com/619e15d781b21202de206fb5/63342cc3390c666215e4b11d_using-katalon-studio-with-headspin.jpg)
![Create a test project in Katalon Studio | Katalon Docs Create A Test Project In Katalon Studio | Katalon Docs](https://docs.katalon.com/46677cc0-2916-11ed-9930-0242fe3e4a3f/ks-850-new-project.png)
![Set up remote server in desired capabilities in Katalon Studio | Katalon Docs Set Up Remote Server In Desired Capabilities In Katalon Studio | Katalon Docs](https://docs.katalon.com/8eaf7560-22b2-11ed-9930-0242fe3e4a3f/KS-DC-REMOTE-Set-DC-for-Appium-driver.png)
![Katalon Studio 6.3: Take a look at our new and exciting features Katalon Studio 6.3: Take A Look At Our New And Exciting Features](https://f.hubspotusercontent20.net/hubfs/2465122/Imported_Blog_Media/dark-mode-1024x571.png)
![Katalon Studio v8.6 With TestCloud Integration | New Release Katalon Studio V8.6 With Testcloud Integration | New Release](https://cms-cdn.katalon.com/Feature_img_in_web_ab91216b60.png)
See more here: kientrucannam.vn
See more: https://kientrucannam.vn/vn/