How To Setup Appium Test Environment For Windows

Appium is an open-source project which can test mobile application automatically. Before you can use it to run a test case for a mobile application, you need to set up a test environment for it. This article will show you how to set up the Appium test environment step by step.

1. Install JDK.

  1. You can read the below articles to learn how to install JDK and set java environment variables.
  2. Beginner’s guide for install JDK(java development kit) and eclipse in windows
  3. How To Set Java Environment Variable JAVA_HOME, CLASSPATH, PATH

2. Install Android SDK.

  1. Article Setup Android App Development Environment will tell you how to install Android Studio.
  2. In the Choose Components wizard dialog of the above process, it will install Android SDK for you if you select both the Android Studio, Android SDK, and Android Virtual Device check box.
  3. In the next Configuration Settings wizard dialog, you can specify where your android SDK will be installed. In our example, android SDK is installed in the folder C:\Users\Jerry\AppData\Local\Android\Sdk. Save this directory in a text file.
  4. You can also find the Android SDK directory after Android Studio installation. Click ” Tools —> Android —> SDK Manager ” in the android studio top menu.
  5. Click Appearance & Behavior —> System Settings —> Android SDK menu item on the Default Settings wizard dialog left side. Then you can find the android SDK install directory in the right side Android SDK Location area.

3. Setup Android SDK Environment Variables.

  1. After installing Android SDK in your windows OS, you need to setup android related environment variables to execute Appium.

3.1 Add ANDROID_HOME Environment Variable.

  1. Click ” Start Menu —> Control Panel —> System and Security —> System”.
  2. Click “Advanced system settings —> Environment Variable”, then popup the Environment Variables settings dialog.
  3. Click the New button to add the ANDROID_HOME environment variable, the value is just the android SDK installation directory which you saved in step 2.

3.2 Add Android Path Environment Variable.

  1. Edit the environment variable Path in the above Environment Variables dialog, append the value ;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools at the end of the current value.

4. Create Android Virtual Device.

  1. Before you can run Appium, you should first create and launch an android virtual device. Because the Appium windows version only supports android os from os version 1 to version 6, so we should create an android 6.0 virtual device.
  2. Open Android Studio, click the ” AVD Manager ” icon button located at the top toolbar.
  3. If there is an Android Virtual Device exists, then you can see it in the AVD list. Whether the AVD list exists or not, you can create a new one by clicking the Create Virtual Device button at the bottom.
  4. After you click the ” Create Virtual Device ” button in the above dialog window, it will go to the Select Hardware window, you can choose which device simulator you want to create.
  5. Select the device category in the left side Category list pane, then select the device detail model in the middle pane.
  6. Choose a virtual device name, then click the Next button to go to the next page to see which android os version that device support. Because we want to use android os 6.0, so we choose the “Galaxy Nexus” device. If you see a Download link beside Release Name, then you need to click it to download and install that os image in your PC, this process may take some time.
  7. Click ” Next —> Finish ” to complete the AVD creation, this may take some time also.
  8. After that, you can see the newly created AVD in the list, click the green triangle button in the Actions column to launch it.

5. Install Node.js.

  1. Appium is written using Node.js. So we need to install Node.js to run Appium.
  2. Go to the Node.js download page.
  3. Download related version. In this example, we need to download windows version node-v6.11.4-x64.msi.
  4. Then double click the node.js installer to install it as normal, you do not need to do any special configuration during the installation process.

6. Install Appium.

  1. Go to the Appium download page to download the Windows version.
  2. After download, unzip it to a local folder. Click the appium-installer.exe to install.
  3. Just use the default value during the install process, do not need to do any special settings.
  4. After your installation, you can see an icon Appium —> Appium in the Windows Startup menu.
  5. Click the above button to open the Appium server window.

7. Launch Android App From Appium.

  1. Now you can use Appium to launch an app from it.
  2. Start android virtual device emulator “Galaxy Nexus ” which runs os 6.0 in step 4, this may take some time.
  3. Click the Android Settings button to open the Appium dialog. Select your APK file path which you want to test in the application section, in the Capabilities section select Platform Name, Automation Name, and PlatformVersion. The maximum value for PlatformVersion is 6.0. Input a Device Name as you like.
  4. In the General Settings dialog, check the “Pre-Launch Application” and “Override Existing Session” checkbox.
  5. Now you can click the Launch button to start your android app from Appium. During this process, you can see a lot of log data print out in the Appium console.
  6. Now the Appium test environment for Windows has been set up completely. You can test the app manually or by automation testing code. We will show you how to write test code in later articles.

2 thoughts on “How To Setup Appium Test Environment For Windows”

  1. Unable to enter the text in login username field,
    With the same script able to run the script in Appium studio and Device also but the script is not working while running using appium server

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.