Prerequisites

  • Create a Project, add an Application and an Application Version inside it.
  • Create a Test Case and add a few Test Steps in it.
  • Create a Test Suite and add the Test Case to it.


Creating a Project, Application and Application Version


If you are new to Testsigma and you are not yet familiar with Testsigma Project Hierarchy, check the Sample Project article to get familiar with the Project organization in Testsigma.

A Sample Project explaining the Testsigma Hierarchy


After that, please check the below articles for a detailed guide to creating Projects, Applications, and Versions.

How to Create/Edit/Delete Project?

How to Create/Edit/Delete Application?

How to Create/Edit/Delete Version?


Create a Test Case and add a few Test Steps in it


Please check the following articles for a detailed guide to creating Test Cases and Test Steps:

How to add/edit/delete an automated Test Case?

How to add/edit/delete automated Test Step?


Create a Test Suite and add the Test Case to it


Please check this article for more details on creating a Test Suite - How to add/edit/delete Test Suite?


You can bypass the Test Suite creation requirement by using a Quick Run or Dry Run.

Please check this article for more details on Quick Run and Dry Run - Different Types of Execution Methods in Testsigma


Overview

Considering you already have a Test Suite containing Android Application Test Steps, the procedure for Executing a native Android Application in Testsigma in a local environment are as follows:


1. Add the local test machine(PC) as a System in Testsigma.

2. Set up the local PC and mobile device for hybrid Execution.

3. Create Execution and add Execution Configuration.

4. And finally, start the Execution!


1. Add the local test machine as a System in Testsigma


Assuming that you have a Test Suite consisting of a one or more Test Cases inside it ready for Execution, we can move onto setting up the local machine for Hybrid Execution. But before that, we need to add the local machine to Testsigma Database so that we can select it as the Test Machine while creating Execution.


Please check this article for creating a System: How to add/edit/delete System?


Once the System is added to Testsigma, we can move onto setting up the machine for Hybrid Execution by installing Testsigma Agent and configuring it.


2. Set up the local machine for hybrid Execution


Once the local System is added to Testsigma, we need to perform some configurations on the Local machine where tests are to be run.


This is done so that the local machine can accept communication in the form of HTTP packets from Testsigma servers. This step is preconfigured in other Cloud Execution Models such as Testsigma Labs, Sauce Labs, and BrowserStack. If you prefer the easy method, you may use the cloud execution models in which you can select the execution environment from the list of available OS/Browser/Version Combos. Please check this article for more details - How to execute tests in Testsigma Labs, Sauce Labs or Browserstack?


Continuing with the Hybrid Execution setup, we need to first set up the Testsigma agent on the local PC. Please check the following article for a detailed guide on setting up Testsigma Agent on local PC for Hybrid Execution:

Setting up Testsigma Agent on your local Windows/Mac/Linux machine

Configurations on Local PC

In case of Hybrid Execution for Android devices, we need to perform two additional steps along with configuration required for Hybrid Execution on Desktop machines.


1. We need to install Android SDK Tools to get Android Debugging Bridge(ADB). The easiest way to do this is installing the Android Studio provided by Google. The Android SDK Tools come bundled with Android Studio. Check the Official Android Studio documentation page for more details on installing Android Studio.

Android Studio - Installation Guide


2. Also, we need to install Appium Desktop Application for the local PC to communicate with the mobile device and run tests on it.

Appium Desktop - Official Github release page


Install Appium Desktop and start the Appium Server with default configuration i.e Host address - 0.0.0.0 and port - 4723. You may also use the localhost IP if you prefer i.e Host Address - localhost and port - 4723

Check the README section on the Appium GitHub page for more details.

Please take note of the Host Address and Port as we need to enter the same while adding an Execution Configuration to the Execution in a later stage.


Configuration on Local Android Device

Also, we need to do a few things on the mobile device to enable Test Execution on it.


1. Enable Developer Options


2. Allow USB Debugging

Check the Android Documentation to know how to enable developer options and USB debugging


3. Allow installation from Unknown Sources

Here's an easy guide to enable unknown sources.


Now we can create the Execution Configuration in which we will specify the necessary device details we set up till now.


3. Create Execution and add an Execution Configuration

We are almost there. The local machine is configured with Testsigma Agent and the machine is ready to accept communications from Testsigma servers to start the Execution. Also, Appium Server which routes the Commands from the PC to the mobile device is running(we started it in the previous step) in the background.


Now we can start creating the Execution. Please check the following article for a detailed guide:

How to create/edit/delete Executions?

How to add/edit/delete Execution Configuration?


While creating the Execution Configuration for Android, we need to tell some extra information in case of Hybrid Executions for Testsigma to connect to the local Android device properly. The most important fields on the page are:


Machine: Select the local System we added in the previous Step. This is the System which Testsigma communicates directly with. The Test Android device should be connected to this System.


OS Version: Select the Android OS version in the Test Device.


Appium URL: Enter the Appium URL in the below format using the Host Address and Port of Appium Server you started in the previous step. If you used the default configuration, i.e Host address - 0.0.0.0 and port - 4723, the URL would be:


http://0.0.0.0:4723/wd/hub


If you used another configuration i.e Host Address - localhost and port - 4723 while starting the Appium Server, you can use the following URL:


http://localhost:4723/wd/hub


Device Name: Enter the serial number of the Android Device.


Use Apk: Use this option if the App to be tested is located on the PC and you don't want to install it on the test device.

  • Apk Path: Specify the Path to the APK file. The Path can be either the URL of the APK file uploaded on cloud or URI to the file located on the machine's filesystem


App Details: Use this option if the App is already installed on the Test Mobile device. This is the recommended option.

  • App Package: Package name is the unique identifier of an Android App
  • App Activity: Activity name is the name of a specific Android App Screen or Page
Check this article to know how to find App Package name and Activity name - How to find App Package and App Activity?


Use Uploads:

  • App Name: Select the Application file uploaded to the Testsigma Cloud by name.


Once the Execution Configuration is created, we can finalize the Execution creation by clicking on Create button.


4. Start the Test Execution!

Goto the Execution page if not already there and make sure the following conditions are met before starting the Execution:

  • Make sure the Testsigma Agent that we started earlier is running by refreshing the Agent page. Also, check the Agent is running in a command prompt window titled 'Tomcat'
  • Make sure the Appium Server is running
  • Check the mobile device is connected by checking the output of 'adb devices' command. You should see the device serial number if the device is connected properly.

Once all the above checks are done, you can start the Execution. Goto the Executions page and click on Run Now near the corresponding Execution name. That's all we need to do for performing a Hybrid Execution on a local Android Device.


Welcome to era of #SmartTestAutomation!!