One of mobility’s great challenges has been to replicate the benefits DevOps and Agile methodologies bring to traditional Web development. Although mobility is the clear successor to traditional Web development, rapid deployment into test environments and hands-off test case automation on real mobile devices have been challenging for the mobile space largely because of app store models and other restrictions imposed by phone and tablet manufacturers.
Test Build Deployment Automation
The ground DevOps has gained for Web testing includes automatically and rapidly building test environments that mirror their production targets and managing multiple automated test cases. Mobility is in great need of these same benefits, and deviceConnect™, Mobile Labs’ private mobile device cloud for mobile testing, can get the job done. Mobile Labs partnered with IBM, for example, to offer a plug-in to that company’s UrbanCode Deploy product, a part of Rational test suite. The Mobile Labs’ plug-in combines deviceConnectCLI’s real-device deployment capabilities with UrbanCode Deploy’s automated deployment processes. You can read more about Mobile Labs and UrbanCode Deploy in our recent blog post, “Mobile Labs Partners with IBM for Mobile DevOps.”
deviceConnectCLI is capable of adding or removing versions of apps from the deviceConnect data base, and can install, remove, or update apps on real devices quickly and easily. It is easy to build scripts that obtain a list of devices, select devices based on their capability, and then connect to devices and launch apps.
Automated Mobile App Testing: Test Case Automation
To build a self-sufficient, fully automated test case, an automation script needs only to issue a deviceConnectCLI command to connect to a device. To build an example of test case automation that manages a test case on four devices concurrently, we used HP ALM. This allowed us to initiate test runs on remote virtual machines with no manual intervention. deviceConnect, Mobile Labs Trust™, ALM, and UFT cooperate to load a test case, retain and open a deviceConnect device, and then to run the test case. After the case finishes, the device is closed and returned to the available pool. Run results can be viewed immediately or at a later time, including screen captures of each step. It is also possible (but not necessary) to open the virtual desktops and see the tests run.
We put deviceConnectCLI parameters into a data sheet as shown below:
We then built the following command-line parameters from the data sheet. These parameters are passed to deviceConnectCLI:
10.1.10.54 firstname.lastname@example.org abcdef12 -d “asus_05e89b1a” -scale 50 -r “Phone Lookup”
The parameters locate the deviceConnect cabinet, pass it a valid username and password, create a connection to a device, and then launch the app on that device. We start the device session with this VBScript command:
SystemUtil.Run “MobileLabs.DeviceConnect.Cli.exe”, strConnectParam, Environment(“strCLIPath”)
The variable “strCLIPath” contains the path to the deviceConnectCLI program on our system and comes from the CLI_Path cell in the data sheet. To automate this test from HP’s ALM, we saved and imported a data sheet for each device we wanted to test. The same script is used on all devices. We also passed the IP address of each virtual machine.
The video below shows the process automatically obtaining four devices, and with a reduced-scale view of each of the virtual desktops on screen, we can see the four tests running at the same time. Note that we chose to view the desktops, but the machines would have — and did — run unattended, with run results available for viewing at our convenience. A single script drove an Android phone and tablet as well as an iOS phone and tablet.
deviceConnect brings the gains of DevOps to mobility by automating the deployment of test builds and by running test cases against those builds as a part of continuous integration and, if desired, continuous testing. The capability to automate mobile app build deployments as well as to automate test cases against those builds brings the high-velocity integration and test integration benefits so widely enjoyed in standard Web development to the developers and testers of mobile apps.
Learn more about deviceConnect, and the Mobile Labs solutions here.