In order to automate mobile test cases on Windows Computers using virtual devices (also called emulators), you must download and install Android Studio and Intel® HAXM.
Once these components are installed and environment variables are set, your system is ready for test case executions.
Executing test case on real device does not require Android Studio.
Installing Android Studio
In order to test Android mobile applications, you need to download Android Studio. Once Android Studio is downloaded, Qualitia users can create virtual devices / emulators and test the mobile applications using Qualitia. You can view the detailed procedure about creating and managing Android virtual devices, click here. To install Android Studio: Select Standard Installation. Android Studio is developed for Android application development. In order to get started with application testing using virtual devices, users need to have at least one project created. Once project is created, users can create and start emulators and download required platform images from the Android Studio. Select required packages to install and click Apply. Google system images are required to create and start virtual devices (emulators). Generally, emulators created with Google APIs Intel x86 Atom System Image serve all the testing requirements, however, users can download and install any system image depending on the testing requirements. If you want Google Chrome in the Nougat emulator, please select Google API as system image. Google Chrome comes as a default browser for Nougat and not for other Android operating systems. Go to SDK Tools and ensure that Android SDK Build-Tools is installed. If not, then download it. Click OK. Once all the required components are installed, click Finish.
This will start installation of Android Studio.
Now you can start creating virtual devices.
Installing Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
We recommend that you install Intel® HAXM for smooth functioning of Android Virtual Devices (emulators). When installing Android Studio, it is installed automatically. However, if it is not installed when installing Android Studio, follow the steps mentioned below to install it.
To confirm whether the Android Studio is installed or not, go to Android Studio > Tools > Android > SDK Manager
To install Intel® HAXM:
- Download Intel® HAXM.
- Unzip the downloaded file.
- Double-click the intelhaxm-android file.
This opens Intel® Hardware Accelerated Execution Manager Setup wizard. - Click Next.
Here you can define how much system memory (RAM) you want to reserve for Intel® HAXM. By default, 2.00 GB is reserved. - Change the reserved memory if required and click Next.
- Click Install.
After successful installation, open the Command Prompt window and run the command; sc query intelhaxm.
If State is shown as Running, Intel® HAXM is running properly.- When creating emulators, ensure that you have selected CPU/ABI as Intel x86 for superior performance of emulator through Intel® HAXM.
- If you are facing any issues when installing or using Intel® HAXM, click here for troubleshooting.
Setting Environment Variables
After you download Android Studio, you must set environment variables.
To set Environment Variables:
- From desktop, right-click the Computer icon.
- Select Properties from the context menu.
- In the left pane, click Advanced System Settings.
- On the System Properties window, click Environment Variables.
- In the User Variables section, create new variable as ANDROID_HOME and enter the path of Android SDK.
To find the Android SDK location, launch Android Studio > File > Settings. Copy the path specified in Android SDK Location.
For example: D:\Android - Click OK.
Note: The Android_Home path should not contain any white spaces. - If Java_Home is not already set, create a new variable as JAVA_HOME, type the path to JRE/JDK and then click OK.
- In the System Variables section, select the PATH variable and type the path to 'Platform-tools' from the Android SDK location (which you added in the step 5 above).
For example: D:\Android\platform-tools. - In the System Variables section, select the PATH variable and type the path to 'tools' from the Android SDK location (which you added in the step 5 above).
For example: D:\Android\tools. - Click OK.