Welcome to this series on Appium! I have gone through more pain than I would have liked getting Appium installed and configured recently. There is some reasonable documentation and guides out there, but the ‘good’ information is somewhat scattered amongst various sources on the Internet and alot of it is out of date. I must also say that I found the documentation on the official Appium site to be quite inaccessible (especially for a relatively inexperienced user) and badly in need of an update. For me it didn’t explain in enough detail what the steps for the installation were, and it also contained some mistakes and redundant information. I guess that it is part and parcel of an open-source project though, and once you have everything installed and configured, Appium really is an awesome tool. So this series on Appium from Scratch is my attempt to try and save some of you from going through the trouble I did!
This is the guide to get installed and setup on Windows (the Mac guide is coming soon). Let me remind you (in case you didn’t know) that if you are using Appium on Windows then you will only be able to test Android. If you are using it on a Mac, then you can test on Android AND iOS, so that is obviously the better option if you are testing both and the only real option, (say for a complex VM setup) if you need to test on iOS. If you are only interested in Android, then you should be fine on Windows.
So this is a complete, newbie friendly, “From Scratch” guide to getting installed and setup with Appium. We will cover everything that you should need starting with the prerequisites in this very post. Chances are you already have some or all of the prerequisites installed on your environment, so feel free to skip anything that you don’t need, but I have included everything here for completeness. At a high level, the list of software you need is:
- Java JDK version 7 or higher
- .NET Framework version 4.5 or higher
- NodeJS version 4 or higher
Let’s get started!
Step 1: Install Java JDK version 7 or higher
I expect that most people reading this guide (developers and testers) will have the JDK installed, but in case you don’t (or you aren’t sure)…. Yes you do need the JDK!
If you aren’t sure whether or not you have the JDK installed, then you probably don’t. If you want to check, you can open Control Panel > Programs and look for it on there. If you can’t find it on there, then go and download the JDK from this link . Make sure that you download the JDK, not the JRE! Assuming that you are installing on a 64-bit Windows system, download the x64 version as in the screenshots below (if you are still on 32-bit Windows, get the x86 version instead):
Once you have downloaded the file, run it to launch the installer and follow through the wizard (there shouldn’t be anything tricky here, but make a note of the location that you install to). Once it is installed, we have a bit more configuration to do, we need to set the JAVA_HOME variable in Windows. First things first, open a File Explorer window and find where the JDK was installed. For me, my folder path is “C:\Program Files\Java\jdk1.7.0_79“. Copy this directory to the clipboard
Now we need to open the “Advanced System Settings” in Windows. There are a bunch of different ways to do this, one way that should work on Windows 7 and 8 is to open Control Panel > System > Advanced System Settings. From here, click on the ‘Advanced‘ tab and click on ‘Environment Variables‘ . Under SYSTEM VARIABLES, click ‘New‘, enter the variable name JAVA_HOME and the variable value as the folder path you copied before. See the screenshot for an example:
Click OK to save and close. We are almost there, but there is one more important step! We also need to add the JDK’s bin folder path in the path variable of SYSTEM VARIABLES. You might have no idea what I am talking about, but don’t worry, just follow along! Open Environment Variables again as above. Under SYSTEM VARIABLES scroll down until you find the variable named ‘Path‘, highlight it and click edit. Now be careful here as you just want to append the folder path to the end, you don’t want to override everything! Scroll to the end of the variable value (it is probably very long) and add a ‘;‘ (if there isn’t one there already), and type the following “%JAVA_HOME%\bin” . What this does is takes the JAVA_HOME variable that we just specified (i.e. C:\Program Files\Java\jdk1.7.0_79) and adds ‘\bin’ to it . Click OK on everything to save and close.
Great! Before we finish there, let’s just check that we have actually installed everything correctly. Open up a command prompt and type in :> java -version . You should see a message as in the screenshot below. The JDK is now installed and configured correctly!
Step 2: Install .NET Framework version 4.5 or higher
If it isn’t there, then you are probably best off doing a Google search for the latest version of the .NET framework and downloading that. At the time of writing, you can find version 4.6 of the .NET Framework here , but beware that might be out of date by the time you read this! Download the installer and follow the steps to get it installed.
Step 3: Install NodeJS version 4 or higher
Great, that’s all the prerequisites for Appium installed! In the next post, we will look at getting the Android SDK installed, and see how we can configure some Android Virtual Devices (AVDs) that we will use to test on!