Network virtualization, preference testing, and testing for various networks

This article showcases a simple test case that runs on multiple network conditions and measures the output for every condition.

Various types of networks are used for data transfer with intermittent connectivity issues. Objective of this test would be to check the application behavior with different connection types under data transfer conditions.

Following are usual scenarios that are tested for network preferences:

  • Observe application behavior under various states of connections or when disconnected
  • Observe synchronization behavior under various network conditions of being connected, disconnected or intermittently connected
  • Observe behavior under “flight mode”
  • Switching over connection types from Wi‐Fi to a cellular network and vice‐versa

This test case:

  • Launches Kayak App
  • Sets the network condition to 2G, 3G and 4G for 3 different executions which happen
  • Calculate the time taken to "Find Hotels" on the app

Check the last part of the video to see how much time it takes to "Find Hotels" on various networks.

You can use a Maven-based Web project that runs on 3 iOS devices. To run this project:

  • Clone the project from PerfectoCode GitHub repository.
  • Make sure you have installed Maven and TestNG in your Eclipse.
  • Import the project as an "Existing Maven project" into your existing workspace.
  • Open the Utilities.Java file, located under the com.perfecto.utils package.
  • Set the cloud host name, your Perfecto cloud user ID and password at lines 34, 35 [or replace these lines with your Security token] and change the host name.
  • In the project folder, double-click testng.xml. Change the device IDs as per your devices.
  • Right-click testng.xml and select Run as > TestNG Suite.

That's it!

Be sure to check the PerfectoCode GitHub repositories for more official Perfecto samples and the Community samples. To learn more, see the Network Virtualization Capabilities article.