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 test case for mobile application, you need to setup test environment for it. This article will show you how to setup Appium test environment step by step.

1. Install Jdk

You can read below articles to learn how to install jdk and set java environment variables.

Beginner’s guide for install jdk(java delvelopment kit) and eclipse in windows

How To Set Java Environment Viriable JAVA_HOME, CLASSPATH, PATH

2. Install Android SDK

Article Setup Android App Development Environment will tell you how to install Android Studio. During that process, it will install Android SDK for you if you select the check box as below.

android studio setup step2

In the next wizard dialog, you can specify where your android sdk installed. In our example, android sdk is installed in folder C:\Users\Jerry\AppData\Local\Android\Sdk. Save this directory in a text file.

android studio setup directory

You can also find android sdk directory after Android Studio installation. Click ” Tools —> Android —> SDK Manager ” in android studio top menu.

android studio menu item tools android sdk manager

Then you can find android sdk install directory in the popup dialog as below.

android studio android sdk settings popup dialog

3. Setup Android SDK Environment Variables

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

Add ANDROID_HOME environment variable.

  1. Click ” Start Menu —> Control Panel —> System and Security —> System”.
  2. Click “Advanced system settings —> Environment Variable”, then popup below dialog.
    set JAVA_HOME in windows system environment properties
  3. Click New button to add ANDROID_HOME environment variable, the value is just android sdk installation directory which you saved in step 2.
    add android home environment variable
READ :   How To Use Android Debug Bridge (ADB)

Add Android Path environment variable.

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

4. Create Android Virtual Device

Before you can run Appium, you should first create and launch an android virtual device. Because Appium windows version only support android os from os version 1 to version 6, so we should create an android 6.0 virtual device.

  1. Open Android Studio, click ” AVD manager ” icon button located at the top tool bar.
    avd manager in the tool bar
  2. If there has android virtual device exist, then you can see avd list. Whether avd list exist or not, you can create a new one by click create virtual device button at bottom.
    create android virtual device wizard
    android virtual device list manager
  3. After you click ” Create Virtual Device ” button, you can choose which device simulator you want to create.
    android virtual device detail settings
  4. Choose a virtual device name, then click Next button to go to next page to see which android os version that device support. Because we want to use android os 6.0, so we choose “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.
    android virtual device target android os version
  5. Click ” Next —> Finish ” to complete avd creation, this may take some time also.
  6. After that you can see the new created avd in the list, click the green triangle button in Actions column to launch it.
    launch avd in avd list

5. Install Node.js

Appium is written use Node.js. So we need to install Node.js to run Appium.

  1. Go to Node.js download page.
  2. Download related version. In this example we need to download windows version node-v6.11.4-x64.msi.
    node js download page
  3. Then double click the node.js installer to install it as normally, you do not need to do any special configuraton during the installation process.
READ :   Appium Introduction : Concepts, Design, Architecture

6. Install Appium

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

7. Launch Android App From Appium

Now you can use Appium to launch app from it.

  1. Start android virtual device emulator “Galaxy Nexus ” which runs os 6.0 in step 4, this may take some time.
    avd galaxy nexus
  2. Click android settings button to open a dialog as below. Select your apk file path which you want to test in application section, select Platform name, automation name and PlatformVersion in capabilities section. The maximize value for PlatformVersion is 6.0. Input a device name as you like.
    appium android settings
  3. In general settings dialog, check “Pre-Launch Application” and “Override Existing Session” checkbox.
    appium general settings
  4. Now you can click Launch button to start your android app from appium. During this process you can see a lot of log data print out in appium console.
    launch android app from appium
  5. Now the Appium test environment for Windows has been setup 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 Comments


  1. Unable to enter the text in login username field

    Reply

  2. 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

    Reply

Leave a Reply

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.