View all web browser and mobile devices available in our cloud-based test lab.
All mobile application developers and testers experience the same challenge: ensuring the application will respond gracefully and as expected no matter where their mobile applications are being used and under which conditions. Such conditions include airplane mode, no network connectivity, poor network connection and 2G, 3G or 4G network speeds.
If a user is using a banking application and goes into an elevator or a subway, does your application handle that scenario gracefully? By testing real end user conditions, teams can ensure a high-quality mobile application user experience, advanced test automation coverage (and ensuring they will test the application before their users do).
With Perfecto and Appium, you can simulate all the network scenarios we have listed above and more. You can use the out-of-the box-network user profiles to simulate cellular network speeds. You also have the flexibility to create your own custom network conditions by manipulating metrics like latency, packet loss and bandwidth in and out. We make it easy to simulate the cellular networks with user profiles, and if you need custom control, you have easy access to that as well.
This blog will explore network virtualization testing with the integration of Perfecto and Appium in more detail.
Related Resources >> User Simulation Testing for Mobile Apps
Perfecto provides advanced network virtualization on top of open source Appium. Network virtualization plus additional Perfecto capabilities enables you to:
The Perfecto continuous testing platform allows you to simulate these different network conditions in a manual test or an automated process by using Appium on both iOS and Android. We will dive into this below. For manual testing, you can also use the Perfecto UI and the “Network Virtualization” widget:
When it comes to embedding network virtualization functionality using real mobile devices, Perfecto provides a testing platform with advanced network simulation functionality built on top of open-source Appium. Perfecto provides an easy to call method that can be added to your Appium scripts in about 5 to 10 lines of code, depending on what you are trying to do.
Below I call the method in “startNetworkVirtualization” and send the necessary parameters to the method that implements the actual lines of code shown in a later snapshot in this blog.
You can reference the documentation for a comprehensive explanation here.
Perfecto makes testing network conditions easy by providing you with a number of user profile network conditions already packaged for you and ready to use. These enable easily simulating different cell network speeds from 2G to 4G.
Here is a small sample of User Profiles:
You can also customize your network conditions. If you want to customize your own network speeds and other variables for advanced user scenarios you have that flexibility. It is as easy as providing the parameter and the value you want the parameter to simulate. Some of the more popular parameters include:
You can enable parameters when starting or stopping the network simulation that will capture Single User Performance information if you want to understand the HTTP traffic. You can generate HAR (Http Archive files) and PCAP or Packet capture files. Examples of these parameters can also be seen in the code snippet below. You can also capture device vitals using other built in methods provided by the Perfecto Platform. For understanding the load performance time, use UX timers.
Look at the following code samples to see examples of using the out-of-the-box user profiles, updating the network settings, disabling the Wi-Fi, turning on airplane mode, and more. Below shows how you can call each command in a method. In the snippet above we show examples of calling one of the methods in Appium and Java.
After the test has been executed, you will be able to see each line of code and corresponding action at the test step level within the Perfecto UI. You also have a rich set of artifacts to select from for testing, such as video recordings, Snapshots, Device Vitals, PCAP files, HAR files, Crash logs and other relevant data like page load time duration. Testers can quickly find the root cause of any issues they are investigating with all this data. You can share the data amongst your teammates so they can reproduce any issues quickly.
Perfecto is the continuous testing platform that is always on and always ready to run. Perfecto provides the devices, desktop browser combinations and the infrastructure that can scale to support hundreds and thousands of automated tests every day.
Perfecto also supports a wide range of advanced automation scenarios for iOS and Android on top of open-source Appium. In addition to network virtualization testing, these include:
These can be run and used as simply as the examples provided in the blog. If you’d like to have details on these, please reference our online documentation.
See a custom demo of network virtualization testing with Perfecto and Appium.
Get My Demo