Introduction
Appium Setup
RequirementsInstall AppiumSetting Up AndroidSetting Up iOSSetting Up An EmulatorSetting Up WindowsCompiling Your App (Native Apps)Compiling Your App (Hybrid Apps)Setup A Code Editor
MoQuality Tutorials
MoQuality Dashboard
Integrations
Common Issues

Setting Up Windows

Overview

In this article, we will detail how to get your Windows computer up and running with Java, Android Studio, and running tests via Appium.

Requirements

For this tutorial, we will assume you are running a Windows 10 system and you will need to download the following:

  • Latest stable version (10+) of NodeJS
  • Android Studio and platform tools (included by default)
  • Java Development Kit (JDK) from Oracle (recommended Java 8)

System Setup

Start off by running the download for NodeJS (at the time of writing the download file name is "node-v10.167.3-x64.msi").

Once NodeJS is installed, go ahead and install the Java Development Kit and remember the location where it was installed (i.e. C:\Program Files(x64)\Java\jdk1.8.0).

To set the JAVA_HOME environment path, do the following:

  1. In Search, search for and then select: System (Control Panel)
  2. Click the Advanced system settings link.
  3. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New. 4.In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable with JAVA_HOME="<your_JDK_location_mentioned_above">. Click OK. Close all remaining windows by clicking OK.

Android Studio Setup

From this point, simply install Android Studio from the download link and stick with the default settings during installation.

By default, there should be at least one emulator already set up (usually a Nexus 5 device) but if not, you will need to set one up and have it initialized and running in the background. Please see Setting up an emulator with Android Studio for steps on set up.

Nexus 5 Emulator

In Android Studio, access the SDK Manager from the main menu and note the "Android SDK Location" presented in the manager window (should be of the form, **/Users/<your_user_name>/Library/Android/sdk**).

SDK Manager

Appium will need to know where this location is set, so we do this by making sure an ANDROID_HOME environment variable is set the same way we did earlier with JAVA_HOME.

  1. In Search, search for and then select: System (Control Panel)
  2. Click the Advanced system settings link.
  3. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New. 4.In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable with ANDROID_HOME="<your_android_sdk_location_noted_earlier>". Click OK. Close all remaining windows by clicking OK.

Now confirm the PATH variable was set correctly by opening a command prompt and typing:

adb devices

If configured correctly, adb should list the currently running emulator from earlier as something like "emulator-5554".

Setting up Appium

Whew! Congratulations, we are almost done! You just need to get Appium installed at this point with these last few simple steps.

First, open up a new command prompt this time in Admin mode by typing "cmd" in the Start menu and then hitting CTRL+SHIFT+ENTER keys to actually launch it.

Next, install the most recent version of Appium using the NPM program that was installed earlier when you installed NodeJS:

npm install -g appium

After installation, confirm Appium is working by simply typing in the console:

appium

Yay! You are now ready to run an Appium test with an Android emulator on your system!

References

Appium Pro: Edition 91 - https://appiumpro.com/editions/91