cerberus-mobile-app-tutorial-image-feature

Welcome to this Cerberus Testing step-by-step tutorial for testing mobile applications. This guide will help you understand the test automation workflow and good practices supported by Cerberus Testing. 

At the end of this article, you will be able to automate mobile application tests for Android and  iOS. You will learn how to configure your device, create and execute the test case. We will perform the test of an Android application using Browserstack.

As Cerberus Testing is leveraging the Appium library, you can use this tutorial to implement your own test. If you are new to Cerberus Testing, we recommend that you start by having a look at our GitHub page, website and overview video.

Prerequisites

First of all, make sure to have the following elements ready to successfully complete this tutorial:

  • A Cerberus Testing instance in version 4.x, self-hosted or SaaS.
  • A user account granted with a “Test” role.
  • A test environment (by default “QA” and “UAT” are set up).
  • A Local or Remote Mobile Device available through the Appium interface.

In addition, if you decided to implement your own Test, you need to secure the following points:

  • Access to the application under test, as well as to the mobile application package (.apk or .ipa)) in the device. Make sure you have a user account if you need to log in
  • Define the Test action and controls you want to perform and verify if they are compatible with the Appium library

If you have any questions on those prerequisites, have a look at our documentation, videos or contact your administrator. Feel free to interact with the community on our slack channel or submit a GitHub issue.

Step 1 — Setup the Application and Test Robot

This section describes the initial setup and integration to enable the mobile test automation. First, we have to upload the mobile application on the device we want to test. Then, we are able to configure the robot to interact with the device under test. Lastly, we define the application under test environments to reference in our test cases.

1.1 Upload Your Mobile Application

Let’s start by uploading the application under test on the device we will use. In our case, we rely on a remote device using Browserstack App Automate. You can access the configuration tutorial here.

After the successful upload, you will reach the screen below to access the various capabilities required.

1.2 Create The Testing Robot

Our application being ready on the device, we can now configure the Test Robot inside Cerberus Testing.

Here, the following pop-up will appear with the necessary information to describe your robot :

  • Type: Choose either IPA for iOS devices, or APK for an Android one.
  • Platform: Choose the correct one depending on your first option.

You can then add the required capabilities from the previous step.

And finally configure the testing hub integration parameters.

1.3 Create The Application 

Finally, the last step is to create the application under test. This will enable us to reuse the same application definition across various tests, simplifying their maintenance. It involves defining the application name, description, typology and available environments.

The following pop-up will appear with the necessary information to describe your application :

  • Type: Select the same mobile application typology as previously.
  • System: Select to which system this application belongs to.

You can now move to the tab “Environments” where we will configure the test context. Namely, the test environment (QA, UAT), country and host. The host must contain the id of your device under test. The format is “bs:<id>” in our case.

You can configure as many environments as you desire, combining the test environments or countries parameters. They must represent different test contexts you can opt for your test execution.

Step 2 — Create The Test Case

We will now build our test case to be run against the application we just created. In a similar way, we will access the required menu, define our test case content and share tips related to the test creation process.

Click on “Create Test Case” to display the creation pop-up, that we will fill with the required information :

  • Test Folder: Select in which folder you want to keep your test cases. Here choose “Demo”. The folders can be managed in the “Test / Test Folder” page.
  • Testcase ID: Enter your custom ID or leave the default generated one.
  • Test case short description : Enter one-line description, usually in a use-case format “As a <user>, I want to do <use-case> and verify <controls>”
  • Application: Select the application under test, in our case “SampleBSAPK”
  • Status: Choose the implementation state of your test case, in our example we set it to “STANDBY”. For information, the status can be used as test execution criteria and a dashboard is available on the homepage.
  • Type: Select “AUTOMATED” to confirm it is an automated test. You can have manual or private tests but we will not cover them here.
  • Priority: Usually from 1 to 5, it can help you to prioritize your test implementation, reporting or go-nogo criteria for a campaign report. Leave it to “0 – No Priority defined”.
  • Detailed description (optional): Use this box to enter your relevant use-case and test information. As the format is in HTML, you can copy rich content.

The other tabs are not necessary for now. A specific note if you are creating your own test and want to run it in the ”PROD” test environment – you will need to activate this in the tab “Execution Settings” by checking the corresponding box.

Clicking on “Create”, you will confirm the test case creation. If you accept the default test case creation, a default Step will be created. In our case, we will follow a brand new creation process.

Step 3 — Define The Step, Action and Control

We can now configure the test case content using the low code library: Step, Action and Control. A Step is a collection of Action and Control for the main stages of your test. With a good design of those elements, you will be able to reuse them across tests to improve your test maintainability.

3.1 Add the Test Case Step

We can now add a Step via the “Add Step” button and enter the corresponding description. Use clear descriptions in order to have a good test readability with improved maintainability and reusability.

3.2 Add the Test Case Action and Controls

In this step we will detail the various actions and controls that should be performed during the tests. The commands are executed in their order of appearance.

We listed below the parameters that you can use:

  1. Open the mobile application
    • Action openApplication: Open the application set in the Application definition.
    • Please note that you need to start your mobile application test with one of the “open” actions for Cerberus Testing to know where to start.
  2. Take a screenshot after application opening
    • Control takescreenshot: Will take a full screen screenshot (defined it for the sake of demonstration). However, they can be taken automatically at every action or only for errors for example.
  3. Perform various compute operations
    • Action click: Click on the recognized element.
    • Element path xpath=//input[@name=’btnK’]
  4. Verify the search results
    • Control verifyElementTextEqual: In this case, we will verify if the result of our operation is as expected in the result area. A lot of other controls are available and described in the documentation
  5. Close the mobile application
    • Action closeApplication: Close the application to end the session with the robot acting as the interface between your test and the device.
    • This will avoid the test to remain pending and liberate the session.

We confirm the changes by clicking on the “Save Test Case” button in the top right corner.

Step 4 — Run The Test Case

We are now ready to execute our Test Case! Navigate to the Run page by going to “Run / Run Test Case”. By default, the other options are not available until you run the test once in a specific environment.

4.1 Launch the Test via the Run Test Page

Here, the Test Case is selected by default so we can define the execution parameters scrolling down on the page.

Next, confirm the following parameters :

  • Environment: Select one or more environments where the Test Case should be executed. In our case, pick “PROD”.
  • Country: Check one or more countries where you would like to run the Test Case. One more time, the country you select must be defined in the Application. Pick “UK”.
  • Robot Settings: Define the mobile app hub where the Test Case will be executed upon. In addition, you can integrate with other remote testing farms such as LambdaTest, Kobiton, Saucelabs among others.
  • Execution Settings: Mainly related to the traceability levels for the test, test infrastructure and queuing mechanisms (retry, priority, …).

Launch the Test Case and see it running live by clicking on “Run TestCase (and See Result)”.

4.2 Follow the Test Case Execution

You will see this page appearing after the test launch.

If you encounter an issue at this stage, we listed here the common themes:

  • Verify your Application definition, especially for the test environment and country. If you encounter a message related to those parameters this is probably the problem.
  • Verify your Test Case activated Environment. If you cannot launch your test in a Production environment you will need to explicitly activate it in the Test Case Header. 
  • Verify your Robot is correctly running and accessible on the ports you configured. You can manage them on the “Run/Robots” page.

Step 5 — Analyze The Test Case Report

It is now time to analyze the result of our Test Case execution! Once your Test Case is finished, the progress bar on the top will display your Test Status. The main ones are OK or KO, you can access more detailed information in the Cerberus Testing Documentation on Execution Status.  

We described here the various tabs and their corresponding usage :

  • Steps: History of all your Test Case Step, Action and Control performed, with executed data and links to the various screenshots, for instance.
  • Properties: Find here all the Properties used for your test. As we did not define one here, this tab is empty.
  • Execution Details: Traceability related to the Test Case execution including start and end times, status and ID. It is from this tab that you can open a ticket to an external platform if it is configured.
  • Environment: Describes the Test Case environment context.
  • Robot: Traceability of your Robot test infrastructure and browsers.
  • Traceability: Contains the changes made to the execution if any.

Expanding Your Mobile Testing Automation

By now you should have been able to run the example we described or even a test case of yours. We hope this tutorial was helpful for you to understand the main stages involved to automate your mobile testing.

You can now expand your testing by creating reusable step libraries, duplicating or composing your test case and enriching them with specific properties. A good practice is to invest in your Test Design and modules in order to have fast, reliable and maintainable tests. 

Scaling your test automation will be supported by the other capabilities offered by Cerberus Testing. You can for example easily parallelize your tests across various browsers adding a robot in your existing definition.

There is much more to explore that we hope to share with you in the next articles. Feel free to react, engage in the comments, or on our social media. In the meanwhile, Happy Testing!

Leave a comment

Your email address will not be published. Required fields are marked *

Cerberus-Testing Terms Of Service


Website Terms and Conditions of Use

1. Terms

By accessing this Website, accessible from http://www.cerberus-testing.com, you are agreeing to be bound by these Website Terms and Conditions of Use and agree that you are responsible for the agreement with any applicable local laws. If you disagree with any of these terms, you are prohibited from accessing this site. The materials contained in this Website are protected by copyright and trade mark law. These Terms of Service has been created with the help of the Terms of Service Generator and the Privacy Policy Template.

2. Use License

Permission is granted to temporarily download one copy of the materials on Cerberus Testing's Website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:

  • modify or copy the materials;
  • use the materials for any commercial purpose or for any public display;
  • attempt to reverse engineer any software contained on Cerberus Testing's Website;
  • remove any copyright or other proprietary notations from the materials; or
  • transferring the materials to another person or "mirror" the materials on any other server.

This will let Cerberus Testing to terminate upon violations of any of these restrictions. Upon termination, your viewing right will also be terminated and you should destroy any downloaded materials in your possession whether it is printed or electronic format.

3. Disclaimer

All the materials on Cerberus Testing’s Website are provided "as is". Cerberus Testing makes no warranties, may it be expressed or implied, therefore negates all other warranties. Furthermore, Cerberus Testing does not make any representations concerning the accuracy or reliability of the use of the materials on its Website or otherwise relating to such materials or any sites linked to this Website.

4. Limitations

Cerberus Testing or its suppliers will not be hold accountable for any damages that will arise with the use or inability to use the materials on Cerberus Testing’s Website, even if Cerberus Testing or an authorize representative of this Website has been notified, orally or written, of the possibility of such damage. Some jurisdiction does not allow limitations on implied warranties or limitations of liability for incidental damages, these limitations may not apply to you.

5. Revisions and Errata

The materials appearing on Cerberus Testing’s Website may include technical, typographical, or photographic errors. Cerberus Testing will not promise that any of the materials in this Website are accurate, complete, or current. Cerberus Testing may change the materials contained on its Website at any time without notice. Cerberus Testing does not make any commitment to update the materials.

6. Links

Cerberus Testing has not reviewed all of the sites linked to its Website and is not responsible for the contents of any such linked site. The presence of any link does not imply endorsement by Cerberus Testing of the site. The use of any linked website is at the user’s own risk.

7. Site Terms of Use Modifications

Cerberus Testing may revise these Terms of Use for its Website at any time without prior notice. By using this Website, you are agreeing to be bound by the current version of these Terms and Conditions of Use.

8. Your Privacy

Please read our Privacy Policy.

9. Governing Law

Any claim related to Cerberus Testing's Website shall be governed by the laws of fr without regards to its conflict of law provisions.

Thank you for your interest in cerberus,

In order to proceed with your SaaS we need some in order to confirm your instances accesses.

Please provide accurate contacts to secure the process.

You can cancel any time the subscription, please read Terms of Use.