Mobile devices are getting more important than ever in our society. A large amount of Android and IOS applications are developed to make our lives convenient in every possible way.
Most mobile apps are usually running on the devices with various models and different platforms. The automated testing for these apps therefore shall be conducted in diverse circumstances. Testers certainly like to see the automated testing scripts running across devices and platforms without making many changes. One of the solutions for this is from Appium, a well-known automated testing tool for mobile applications.
Appium is an open-source tool for automating native, mobile web, and hybrid applications on iOS and Android platforms. Appium is usually combined with Selenium for automated testing on mobile apps. Testing engineers with selenium experience can conveniently get familiar with this tool and develop automation scripts for mobile platform testing.
An important feature of this mobile testing tool is Cross-platform. Automation scripts are runnable on multiple platforms (iOS, Android, Windows) by using the same set of Appium API. Thus, the automation scripts become reusable between iOS, Android, and Windows test suites, which makes the scripting work more efficient.
How to configure different platform devices to support grid testing
The Appium tool contains two different grid models: Local Grid and Cloud Grid. The major difference between these two models is whether the Appium Hub and the Node are set on the same machine.
However, we would recommend Cloud Grid as the model for grid testing because it can be applied to multiple testing environments. In this model, all the testing devices can be considered as a testing lab. Such labs can be remote, which means during a test, there is no need to have physical devices along with testers or developers.
Here is an example of setting up Cloud Grid for mobile testing.
The parameters of the hub and notes are listed below:
Hub: Windows (hub ip: 10.2.6.46, hub port: 4444)
Node1: Windows (node ip: 10.2.6.46, node port: 4723)
Node2: Mac (node ip: 10.2.6.138, node port: 4723)
(One Tip: Appium Grid allows to set up multiple nodes in one machine with different udid, but one Mac machine can only control one iOS device as iOS automation needs Instruments)
The following are the commands to set up Appium Hub:
java -jar selenium-server-standalone-*.jar -role hub
The configuration of Appium Node is usually maintained with Jason configuration files as shown in the following diagram:
The above configuration is for Windows and Mac Nodes. After that, we need to set up the node by entering the following commands:
appium –nodeconfig (the configuration JSON file absolute path) –no-reset
Notes: the configuration JSON file absolute path is required here
We can also set up multiple nodes on one machine. In this case, we need to specify listener ports for different devices.
The default port for Appium client and Server is 4723.
The default port for Appium server and Testing device is 4724.
However, we can specify the port number to other numbers to avoid conflicts. (e.g. 4725, 4726)
Once all the above steps are completed successfully, the mobile automation testing lab is set up for grid testing.