Prerequisite - Installations
Following needs to be downloaded and installed beforehand. If you need our assistance in configuring the Hybrid Environment, please keep the following ready.
1. Install Java JDK 7 or later and set JAVA_HOME & Path Environment variable
2. Setup Testsigma Agent on your local Machine
Please check the detailed guide for setup - Setup your local machine for Hybrid Test Execution(WIndows/Mac/Linux)
3. Install Android SDK and set ANDROID_HOME Environment variable
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.
Also, set the ANDROID_HOME environment variable to android SDK root directory.
4. Install Android SDK API for your Android Version
Using the SDK manager, ensure you have installed the SDK for Android API levels you wish to automate (e.g., 24).
5. Install Appium Desktop
We need to install Appium Desktop Application for the local PC to communicate with the mobile device and run tests on it.
Note: Please use Appium release version 1.6.2(Appium 1.8.1) to avoid compatibility issues.
Configurations on Local Windows/Mac/Linux Machine
We can configure the local Machine(PC/Mac) as per the steps given below:
1. Once Testsigma Agent is set up and configured as per step 2 in above section, start the Testsigma Agent server by running the startup.sh(startup.bat for windows) script.
2. Open the Testsigma Agent Interface by going to below URL and register your Testsigma Agent with Testsigma Account credentials where the Test Cases are created.
3. Ensuring that Android SDK is set up and configured as per step 4 in above section, Connect the Android Device and start ADB by executing the command 'adb devices' on Command Prompt.
Your device should show up under 'List of devices attached' if Android SDK is configured properly.
4. Start the Appium Server with default configuration i.e Host address - 0.0.0.0 and port 4723.
Note: Please take a 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.
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.
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 in Settings
2. Allow USB Debugging is Settings
Check the Android Documentation to know how to enable developer options and USB debugging.
3. Allow installation from Unknown Sources in Settings
Here's an easy guide to enable unknown sources.
4. Install the App to be automated(Optional)
In order to start a Test Session, do the following steps:
1. Create a Test Case and add a few Test Steps to it.
2. Click on the Run button on the top right to start a Dry Execution and select the following options:
Execution Model: Hybrid
Machine: Select your local device that was added in Configuration > Systems
Appium URL: Default value is http://0.0.0.0:4723/wd/hub
Device Name: Give a unique name for your device
Use APK/App Details/Use Uploads:
Use APK for local APK file
App details if app is already installed on the device.
Use Uploads if APK has been uploaded to Testsigma - Test Development> Uploads
3. Click on Create and Run.
4. Switch to Executions page of Testsigma Agent. If the Execution name is present with status as 'Running', the test will start in the local device in a few minutes.
That's all the configuration required for Automating Android Apps on real Android Devices using Testsigma. Go to the Testsigma App and start the Execution!