Pain-Free Appium Start Guide on Windows


This article is a comprehensive and pain-free Appium start guide using GenyMotion emulator, TestNG framework and IntelliJ IDE. At the end of the article, you can also find how to do mobile automation with real devices.

Prerequisites

  • Appium for Windows
  • Android SDK
  • JAVA JDK
  • IntelliJ
  • GenyMotion Emulator
  • RapidEE (For changing Windows environmental variables easily.)

Step by Step Instructions

Step-1: Install JAVA JDK

Link: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

It is described in this article at step-4.

Step-2: Install Android SDK (Stand-Alone)

Link:  http://developer.android.com/sdk/index.html

Install SDK Tools Only version.

appium

2

2-1

Then, check below options and install them:

  • Android SDK Platform-tools
  • Android SDK Build-tools
  • Android 4.2.2 (API 17)
  • Intel x86 Emulator Accelerator (HAXM installer)
    [It accelerates built-in emulator]

4

5

6

7

Create new environmental variable as ANDROID_HOME and assign it with Android SDK Path.

appium

9

Append Android SDK directory, tools and platform-tools paths to system Path variable.

10

In order to test settings, open command prompt and run adb devices command. You will see below result.

11

Go to, extras\intel\Hardware_Accelerated_Execution_Manager under android SDK folder and install intelhaxm-android.exe . It accelerates built-in emulators.

intelhaxm

Note: If your Intel Virtualization Technology(VT-x) option is enabled in BIOS. You should restart your computer and disable it in your computer’s BIOS.

13

Step-3: Create Built-in Emulator (or you can use GenyMotion (Fast) Emulator ->> Step-4)

Open AVDManager.exe under android SDK path. Then, click “Create” button. After that, set the values as shown in the figure below and click “OK”.

14

You can start emulator by clicking “Start” button.

15

emulator

Step-4: Install and Create Genymotion Emulator (Fast Emulator)

Link: https://www.genymotion.com/

Go to Pricing Page and Select Individual (BASIC) plan and sign-in.

genymotion

Then, click to “with VirtualBox: Download for Windows” button to download it. Then, install it.

18

During installation, trust Oracle Corporation Universal Serial Bus Driver and finish installation and launch Genymotion.

19

20

21

Click “+” sign to add a new device. First, you should sign in.

22

Select a device (I prefer a device with low resolution).

23

24

25

If you want, you can Edit and Delete your emulator anytime you want.

26

Click Start to start emulator. Genymotion is very fast emulator. I highly suggest you to use it.

27

28

Step-5: Install Appium

Link: https://bitbucket.org/appium/appium.app/downloads/

Download the latest release.

29

Extract the zip file and run the installer (appium-installer.exe)

30

Step-6: Open Appium & Emulator and Integrate Them

After Appium installation, right click Appium shortcut and click “Run as administrator

31

Then, Start your Genymotion emulator.

Note: Don’t start Genymotion “Run as administrator” mode!!! If you run as administrator, you cannot drag and drop any item into emulator. Reference link: http://stackoverflow.com/questions/20002138/genymotion-2-0-drag-and-drop

Then, download sample .apk file from here. Andv then save it under “C:\TestApks

33

When you type “adb devices” on command prompt you will see Genymotion emulator as shown below.

35

We should install sample apk into our emulator. First, open virtualbox and do the below settings.

39

40

41

Then, download Genymotion-ARM-Translation_v1.1 from the link below.

http://forum.xda-developers.com/attachment.php?attachmentid=2680937&d=1397258016

and download the gapps-jb-20130813-signed.zip from the link below.

http://en.osdn.jp/projects/sfnet_rommirrors/downloads/gapps-jb-20130813-signed.zip/

Then, follow the guide here to flash emulator with these files.

Here is the video that shows how to do this: https://www.youtube.com/watch?v=vZKiqJyLBkU

After these settings, go to Settings on emulator and apply below settings:

42

Then drag and drop the BitbarSampleApp.apk into Genymotion.

43

Click Android Settings on Appium window.

32

And then, do the below settings as shown below.

34

Then, Click settings icon and set below settings.

54

Then, click to Run icon on Appium.

36

You should see below window.

37

After clicking magnifier icon, inspector window will open and then click “Refresh” button. You will see our test application on inspector window.

44

Alternative Way to Locate Elements: We can also go to “C:\Program Files (x86)\Android\android-sdk\tools” and open “uiautomatorviewer.bat

45

When UI Automator Viewer opens, click the highlighted icon to capture the current view of the application for inspecting elements.

UI Automator is much better option for locating elements.

46

47

Step-7: Writing Test Code with TestNG and IntelliJ

Select New Project

In the New Project window, select Maven on the left side of the screen.

Then, fill the GorupId, ArtifactId as shown below.

48

Copy and paste below line in your pom.xml

Test Scenario:

  • Open the bitBarSample.apk
  • Click second radio button
  • Write “SW Test Academy” on the text area
  • Click the “Answer” button
  • Wait and Check the expected text on the next page

Test Code:

Test Results:

Testing with Real Device

Download your phones driver. I am using Samsung Grand NEO

Link: http://www.driverscape.com/download/gt-i9060

After driver installation you will see below figure on device manager.

49

Then, connect your device and run the following commands

Adb kill-server

Adb start-server

Adb devices

And you will see below result.

50

After that, Change android settings in Appium.

52

Start Appium Server.

53

Then, run the same test on IntelliJ.

Here is the video of the execution:

javafx

Database Operations in JavaFX

By Onur Baskirt / Apr 1, 2016 / 56 Comments
Before started this section, please check the first article and learn How to Start JAVAFX! http://www.swtestacademy.com/getting-started-with-javafx/ At first, part of JavaFX tutorial series, we created a sample JavaFX project, designed the draft version of the UI and set up an...
extentreports

How to Write Smart XPath Locators

By Onur Baskirt / Sep 24, 2017 / 5 Comments
Hi all, in this tutorial, I will describe you how to write smart and non-brittle XPath locators. When we write our test scripts, we generally prefer to use id, name, class, etc. these kinds of locators. However, sometimes we could not...
extentreports

How to Write Effective CSS Locators

By Onur Baskirt / Oct 1, 2017 / 0 Comments
Hi all, in this tutorial, I will describe you how to write effective CSS locators to interrogate web elements for your automation projects. As a rule of thumb, your interrogation strategy should be in below order: First try to use...
rest assured

REST API Testing with Rest Assured

By Onur Baskirt / Mar 8, 2016 / 32 Comments
Outline In this post, I will explain what is API and API testing, what is the difference between SOAP and REST services, and how to test REST APIs with Rest Assured Library. What is API? API stands for Application Programming...
javafx

Getting Started with JavaFX

By Onur Baskirt / Mar 25, 2016 / 0 Comments
When I started to work in my current position, one of my task is to do manual operations for campaign products  every week. After the second week, I thought that I have to automate this task using a GUI based...
extentreports

Selenium-1: Quick Start to Automation with Selenium WebDriver & JAVA & JUnit & Maven & IntelliJ

By Onur Baskirt / Sep 8, 2015 / 26 Comments
Outline Selenium Webdriver is the most popular open source web test automation framework across the wide range of browsers and platforms. In this tutorial, you will learn how to do web test automation with Selenium Webdriver and the related tools....
extentreports

Selenium-11: Execute JavaScript with JavascriptExecutor

By Onur Baskirt / Jan 27, 2016 / 15 Comments
Outline Sometimes we cannot handle some conditions or problems with Webdriver, web controls don't react well against selenium commands. In this kind of situations, we use Javascript. It is useful for custom synchronizations, hide or show the web elements, change...
page object model

Page Object Model with C#

By Ege Aksoz / Jun 18, 2017 / 8 Comments
In the previous tutorial, we’ve taken the initial steps and entered the world of automated testing. We also wrote our first automated test. From this point on, since we are not just going to write one test, we need to...
extentreports

How to Select a Date From DatePicker Using Selenium

By Onur Baskirt / Aug 13, 2016 / 6 Comments
When you need to automate a airway, hotel, or similar websites you need to deal with Datepickers and some times it is a little bit cumbersome to select a specific date on the Datepicker or calendar.  In this post, I...

Getting Started with RobotFramework on Windows

By Onur Baskirt / Apr 25, 2016 / 12 Comments
What is RobotFramework? RobotFramework is a GENERIC test automation framework for acceptance testing and acceptance test-driven development (ATTD). What it means that you can do web, mobile, desktop and other test automation activities with related test libraries. These libraries can...
By | 2017-03-26T02:03:25+00:00 May 6th, 2016|Appium, Mobile Automation, Test Automation|0 Comments

About the Author:

Onur Baskirt
Onur Baskirt is a senior IT professional with 10+ years of experience. He worked at Bahçesehir University, ST Microelectronics, Huawei and Ericsson as research assistant, design verification engineer and software test leader. Also, he worked as software test leader and software operations manager at Turkey's biggest technology retailer, Teknosa. Now, he is working as Head of Software Testing and Manager of two Development Teams at Kariyer.net. His current research areas are technical software testing, programming, and computer science. Formerly, he has several research works and papers on digital chip design & verification. His hobbies are sport, dancing, traveling, and nutrition. You can find detailed information about him on his linked-in page.

Leave A Comment