QuickStart Mobile Automation
QuickStart Mobile Automation Tutorials:
Watch the 4 tutorials to guide you in using QuickStart Mobile Automation in Test Modeller.
Objectives: By the end you’ll be able to:
QuickStart Mobile Automation
We also have QuickStart Automation for Web, Mainframe and API.
Mobile Automation Overview (3mins 49secs)
1 Create a Project (1min 50secs)
2 Configure a Connection (1min 55secs)
3 Create and Edit a Model (2min 25secs)
4 Generate and Run Tests (1min 38secs)
Mobile Automation Overview
This shows how we can go from nothing to very quickly building automation in Test Modeller against mobile applications, in this example for an eCommerce application. By selecting the type of automation we're going to undertake, in this case mobile automation we then go into the explorer screen to create a new model for the log-in screen, and we have a function to open applications.
We also connect to a mobile provider, in this case, Source Labs, or any other cloud-based provider, along with using native Appium against emulated devices. This imports and takes screenshots of the application. To achivve that add functions to start interacting with it, an example being to perform a click action to go and open the menu. Additionally we can select the XPath in Appium Inspector, and equally enter a username and password field.
Quickly re-layout the model ahead of generating paths for a series of test cases and then we can run them. This takes the tests, transfers them into code, and then runs them against our mobile devices that we've specified.
With the completed tests appear the different screen captures as the test has executed against the application.
1 Create a Mobile Automation Project
We'll be going over how to Create a Project for Mobile Automation in Test Modeller. We'll want to navigate underneath our Project and Releases, click Add and there we have an option to create a New Project and selecting Quickstart Mobile from our different types of Automation, in particular here we’re selecting Mobile Automation. We also have QuickStart Automation for Web, Mainframe and API.
So, we already have our Mobile Automation framework set up for the purpose of Executing Test Cases immediately. Now if we navigate to our new project we'll there are four folders: Components in which there are a series of general mobile Actions which are used to Generate our Automation later on. Also we have a folder containing some workable examples.
We have our connections for both Appium and Sauces Labs too, which we'll be covering in the next episode using a shopping App for both native and web. There’s also a folder for accessing any end-to-end Scenarios.
2 Configure a Connection
We'll be going over how to Configure a Connection for Mobile Automation for both Sauce Labs and Appium back inside our newly created project by navigating to the Examples folder and underneath Connections, where we'll see that we have an example model for both Sauce Labs as well as Appium.
Taking the Sauce Labs model as a simple Automation model we can now connect to our Sauce Labs account. Then looking at the Automation Waypoint, underneath the Automation panel, we can see the parameters that we need to enter in order to connect. In this case, the Username and Access key and the Appium connection is exactly the same model. But for this tutorial rather than providing these parameters, we’ll input a remote URL.
For the model generally, we can see that we're just going to capture a screenshot and interact with an element as a way to do bit of a sanity check and make sure our connection is working. So here we can go ahead and Generate our Test Case and Run this to see where the execution was successful. Under Run Results, se see it clicking the element and then capturing a screenshot. Now with that all configured we're ready to go ahead and build out the rest of our models.
3 Create and Edit a Model
We'll be covering how to Create and Edit a Model for Mobile Automation using e-commerce application example and go through a couple of Test Cases in order to add an item to a shopping cart and choose either the colour or how many of each item we want. We use Task blocks to model out the logic of the system, and blue Automation Waypoints contain the Identifier and Automation code necessary in order to Execute Test Cases.
So from here we won't worry about the colour or how many of the t-shirt we want, but just want to add it to our shopping cart by dragging over a new Task block and connecting our t-shirt Waypoint to that remembering to rename it ‘Add to shopping cart’, ready to add Automation.
In the Project Explorer in Components folder we can see those Mobile General Actions, click on an element, and import, which prompts us for a Locator. This is when we can switch over to Appium to can see the T-shirt that we want to add. Test Modeller may prompted to fix the formatting automatically, agree and click save. Rename the new element accordingly.
We can link up this Test Case to the end of our model, and if we generate some new pathways, we'll see that it's now including the T-shirt. Alongside this Test Case there are eight other pathways that run through the model. And we can next add this to a larger end-to-end scenario.
4 Generate and Run Tests
Now to Generate and Execute Test Cases for Mobile Automation in a master model that contains all the components we need to buy an item through our application which is seen as in Subflows which help componentise and make end-to-end Scenarios more understandable from which to Generate some Test Cases, in the example such as this where 22 paths are generated.
Taking a look at our tests we could see it going through each of our pathways in the system. And with our pathways selected, we can now go ahead and Run our Automation to see that our 22 of our tests executed with 20 passes and two failures.
The Run Results show once again screenshots that Test Modeller takes while interacting with the application. And by scrolling down we you can see the test that failed and why. In this it looks like it was having trouble connecting to a remote session.
If you want to find out more about generating test cases, or how to implement different test case coverage techniques, review this How to Generate Test Cases in Test Modeller.
You’ve been following our QuickStart Mobile Automation Tutorials.
Browse more Learning Portal content