Appium Tutorial- A Guide forGetting Started in Windows
Appium is proving to be a hot tool for mobile automation as it allows forcross platform automation tests foriOS, Android,and FirefoxOS applications. This whitepaper is a basic AppiumTutorial to help you get up and running with this tool.
AthoughAppiumis most commonly usedon Macintosh and Linux, many use it on Windows. This tutorialprovides basic instructions and tips for setting up Appium on Windows.A test script is also provided in JAVA written for beginners to start up quickly.
More reasons forselectingAppium;quoteddirectly from http://appium.io/getting-started.html.
1. You don't have to recompile your app or modify it in any way, due to use of standard automation APIs on all platforms.
2. You can write tests with your favorite dev tools using any WebDriver-compatible language such as Java, Objective-C, JavaScript with Node.js (in both callback and yield-based flavours), PHP, Python, Ruby, C#, Clojure, or Perl with the Selenium WebDriver API and language-specific client libraries.
3. You can use any testing framework.
For most people, their first step in learning Appium and knowing how to setup in Windows is to Google and find the following link: https://github.com/appium/appium/blob/master/docs/running-on-windows.md
This is the official site, but it is severely out of date. Therefore, its very hard for most people to accomplish what they want using the information found on this site.
For example, it guides you to install ANT, Maven, and Git; but in fact they are not necessary. Additionally, many explanations are not clear enough for a beginner to understand.
For example; You must supply the --no-reset and --full-reset flags currently for android to work on Windows.
After going through this whole process, deciphering the directions and figuring out what actually is and is not required, weve documented the simplest ways to set up Appium on Windows.
1 Install JDK 1.7 into your Windows 7; configure JAVA_HOME in your environment variable.
2 Install the Android SDK. Make sure you have an API Level 17 or higher. Set ANDROID_HOME to be your Android SDK path;add the tools and platform-tools folders to your PATH variable.
3 Download AppiumForWindows.zip from https://bitbucket.org/appium/appium.app/downloads/. Extract it to C:\.
OK, now youve completed the Appium setup. Wasnt that quick?
Lets run a sample script to get a good feel for how it works.
1 Find Appium.exe from the folder you just extracted in Step 3 above. Double click Appium.exe to invoke Appium. (You need at least .Net Framework 4.0 installed; but we suggest .Net 4.5.)
3 Click File > Preferences, check Reset Application State After Each Session setting.
4 Click the Launch button. If you can see the following information, congratulations, youve started Appium successfully.
5 Download needed files:Junit jar file from https://github.com/junit-team/junit/wiki/Download-and-Install. Selenium jar file from http://docs.seleniumhq.org/download/.
Scripts can be run on both real devices and virtual devices.Virtual devices can be created in Android SDK Tools > AVD Manager. Considering that a virtual device needs a Windows machine with at least 8 GB RAM to perform smoothly, we recommend using a real device.
Get a mobile device with Android version equal to or higher than 4.2.2 and connect to your Windows machine with a USB cable.
Remember to set the USB Debugging setting to ON in your mobile device. Click OK if you see the following dialog box.
To check if the device is really ready, you can use adb devices command to verify.
9 Prepare the APK file. The script showed above is specifically for the attached application HelloAndroid.apk. Download and put it onto your desktop; make sure the path in the line FileappDir = newFile("C://Users//xbosoft//Desktop"); is correct in your machine.
Everything is ready. Now you can run the script in your Eclipse environment.
This basic script will first install the application onto your device; invoke it; click the Test button; click OK button in the confirmation window, and finally close it.
Now you can use this as a base for your test scripts. Just Copy and modify the script for your needs and you can run your first Hello Android for your own application.
As you can see, once you get around the installation maze, its easy to use Appium for multi-platform mobile automation tasks.Compared with test automation on a PC/Web platform, the mobiles screen is much smaller making manual input and operationmuch harder and more prone to errors not only for end users but also for testers!
With mobile test automation, you can automatically handlemanual testing activities that require a lot of manual input and put into yoursmoke and regression testing.This will save both time and your eyesight.
Photo Reference: Cover photo courtesy of Richard Leone http://www.flickr.com/photos/richardleonard/104833424/