Many developers take a hybrid approach to app development. Hybrid apps can benefit from cross platform mobile testing. Companies choose the hybrid approach for several reasons. A major factor is the ability to release on multiple platforms at the same time. The decision of whether or not to make a hybrid app comes down to the skill sets of the various team members developing the app. There are also some downsides to going non-native, such as the possibility of limited features, rendering and responsiveness issues, or crashes on certain devices.
Cross-platform mobile testing is the best testing method for identifying and solving problems related to such applications. Since hybrid applications are developed on a common code base, it makes sense to have functional UI test cases that can be executed on multiple platforms.
What are cross platform tests?
Cross platform refers to the idea that the same tests (scenarios) can be executed on multiple platforms and device types. Imagine your test framework being able to test your hybrid app on both Android and iOS while remaining robust, lean, and easy to maintain. Below we will discuss cross platform mobile application testing services for not only Android, iOS and Windows Mobile but also different devices, like tablets and phones.
In this article we will show you the benefits of cross platform tests, when you should consider them, and what the best practices are regarding them.
Benefits of cross platform app testing
The same scenarios can be executed on different platforms
Let’s stick to the Android and iOS example here. If you find that the following scenario describes the same functionality on both versions of your app, why not have it written only once and executed on both apps?
Scenario:
- As an existing user I should be able to login and see the Home screen
- Given I am on Welcome screen
- When I login
- Then I should see Home screen
In all likelihood, the same test logic will apply for both your Android and iOS apps. Consider how much time we save by writing the scenario and step definitions once, instead of once for each OS. In case a step differs between devices or platforms, you can always keep them separate.
Less code to maintain
Less code not only means that you can script your tests faster, but also that you will save time on maintaining and updating them.
We can break up acceptance tests into 3 layers:
1) Business language scenarios written in a declarative way (describing what you want);
2) QA step definitions written in an imperative way (details how to do it and what to assert for);
3) Screen objects, the interfaces used to interact with an app.
Previously you may have had to write 1 or 2 tests individually, for every platform. Now, if your scenarios are the same for different platforms, you can reuse them. The only layer that will differ is #3, your screen objects. We will explain this in greater detail in a minute.
Faster feedback loops
By automating cross-platform testing with shared scenarios, you get quicker feedback on potential issues across multiple platforms. This allows you to detect bugs and inconsistencies earlier, so this leads to faster iterations and smoother releases across Android, iOS and other platforms.
What apps can be automated this way?
If your app looks and behaves similarly on iOS and Android, or you don’t have different user experiences between tablets and phones, there is a great chance you can benefit from cross platform mobile testing to be automated.
It’s also great for hybrid apps, which are getting more and more popular, since these apps have a consistent look across different platforms.
On the other hand, if your apps are significantly different, it’s better to have dedicated tests covering their unique functionalities. In such situations you should consider having only parts of your app tested the cross platform way. The same applies when the apps have different release cycles; it may be the case that some features are introduced on only one platform at first.
Keep in mind the 3 layers which are mentioned above. It’s not always a good idea to make as many of them as uniform as possible. Sometimes it’s better to have different step definitions for the same scenarios across platforms.
Summary
Cross platform mobile testing is not for everyone or every app. However, cross platform mobile testing can be a powerful tool that saves time and effort, especially as hybrid apps become more prevalent. Many apps have similar user interfaces across operating systems, and these similarities can be harnessed to create tests which work on both Android and iOS (and even Windows Mobile). Cross platform mobile testing is something we embrace and which is becoming ever more important in modern testing. As devices and operating systems continue to fragment, it is imperative to have test scripts which are lean and yet strong, and embracing cross platform mobile testing is one way to help ensure tests remain easy to maintain and update.