Certification: AI-driven Test Automation

Mobile Testing Overview

Mobile Testing Overview

The difference between native and hybrid mobile apps

Hybrid and native mobile apps offer distinct development approaches, which subsequently impact their testing. Native mobile apps are developed using platform-specific languages like Kotlin or Java for Android and Swift or Objective-C for iOS. These apps are optimized for the specific hardware and software of a target platform, giving them direct access to device features such as the camera, GPS, or accelerometer. This direct integration often provides a smoother user experience, tailored to the platform’s standards and behaviors. From a functional testing perspective, testers need to ensure that each platform-specific version of the app functions correctly and interacts seamlessly with the device’s unique features.

On the other hand, hybrid mobile apps are developed using web technologies like HTML, CSS, and JavaScript, wrapped in a native container using frameworks such as Apache Cordova or Ionic. These apps aim to work across multiple platforms using a single codebase. While hybrid apps can also access device features, they do so through native plugins or bridges, which can introduce layers of complexity or potential latency. For functional testing, this means ensuring that the app’s interactions with device features remain consistent across platforms and that the bridge or plugins used do not introduce functional defects. Furthermore, the shared codebase means any functional issue might manifest across all platforms, highlighting the importance of thorough cross-platform testing.

Emulators vs device farms

Mobile app testing can be conducted on actual devices, such as smartphones, or on emulators/simulators. Testing on real devices yields the most accurate results, whereas testing on emulators is generally faster and more cost-effective. Some companies maintain in-house mobile testing devices, while others prefer to partner with device farms, such as BrowserStack or LambdaTest.

testRigor has integrations with both of these testing platforms, allowing customers to run testRigor tests on actual devices hosted by these companies. The user can add the device farm credentials when initially creating a test suite, or later through settings.

What are IPA, APK, AAB files and where and how to get them

IPA, APK, and AAB are file formats associated with mobile applications, and each pertains to a specific mobile platform or distribution method.

  • IPA (iOS App Store Package) Files: An IPA file is the application file format used for iOS devices, like iPhones and iPads. Developers create IPA files using Apple’s development software Xcode. When a developer builds an app for release or distribution, Xcode compiles the app’s source code and assets into an IPA file, which is then submitted to Apple’s App Store for review and publishing. Regular users most commonly encounter IPA files when downloading apps from the App Store, although the process is transparent. To get an IPA file directly (for instance, for testing purposes), developers can archive and export the app using Xcode or retrieve it using tools like Apple’s Transporter.
  • APK (Android Package Kit) and AAB (Android App Bundle) Files: An APK is the package file format used by the Android operating system for the distribution and installation of mobile apps and middleware. APKs encapsulate all of an app’s code (such as DEX files), resources, assets, certificates, and manifest file. Developers can generate APK files using Android Studio or a build tool when they compile and build their application. Users can sideload APKs onto their Android devices, although care must be taken to avoid malicious files. The AAB is a newer, more efficient publishing format introduced by Google. Unlike APKs that contain compiled code and resources for all device configurations, AABs allow the Play Store to generate optimized APKs based on the device’s configuration, reducing the file size and ensuring users download only the resources they need. Developers create AABs using Android Studio, and they submit these files to the Play Store, which then serves the appropriately optimized APKs to users.

testRigor supports the uploading of APK and AAB files. For IPA files, customers need to connect to a provider, such as LambdaTest, and upload the file through that service.

Mobile-specific commands

Most testrigor commands can be used across the platforms, however there are some that are specific to mobile testing. Let’s take a look at these commands.

Click on Home button
press home
click home
press home button
click home button
Click on Recent button (Android-specific)
press recent
click recent
press recent button
click recent button
Restart app
Restarts application without clearing data.
restart app
Switch context
Switch the context of the following actions to the entire mobile device (as for application testing) or start the mobile browser and use only its content (as for web testing).
switch context to native
switch context to browser

Zoom in/out

Use this command to zoom in or zoom out using pinch gestures on native testing for iOS/Android devices.

With this command, users can:

  • Zoom in or zoom out without specifying the location or percentage. By default, the position will be the center of the screen and the zoom percentage will be set to 50%.
  • Specify the percentage for the zoom action and the position on the screen where it should be applied.
  • Define elements and offsets for zooming in or zooming out.
Examples:
zoom in
zoom out "20" % from the middle of the screen
zoom in "10" % on "element" with offset "10,10"

File upload

You can upload a file to an Android mobile device using the following action:
upload file from saved value "sampleFile"
upload file "https://some-page.com/path-to-file" to mobile device

Accessibility testing for Android

testRigor supports accessibility testing for Android Native out of the box. testRigor uses industry leading Deque Axe Devtools as the library for accessibility guidelines.

The way it works is as follows:

  • To do this, enable Run accessibility test on each page in Settings -> Error Reporting:

  • Select from one of the options under Cap accessibility errors to the error level you want them to be reported as.

When enabled, testRigor will run accessibility tests on each page for each run.

Attributes for native mobile application testing

Native mobile applications support the following attributes:

Android
  • content-desc
  • class (usually named something like android.widget.TextView)
  • resource-id
  • text/label
iOS
  • accessibility-id
  • XCUIElementType
  • name
  • text/label

* Note: Hybrid applications tested on testRigor infrastructure use the attributes both from web browser applications and native mobile applications.

Test your knowledge

APK
AAB
IPA
XAP

press recent
press home
zoom in
switch context to native

The issue only affects the iOS version
The issue potentially appears across all platforms due to the shared codebase
The issue arising from the use of Kotlin or Java
The issue being exclusive to the Apple App Store