Sunday, March 27, 2016

Test Automation on Android using Appium, C# and MSTest

This is a two part series of test automation on android using Appium, C# and MSTest.
for part 2 click here.

Prerequisites for this tutorial:

  1. Visual Studio Ultimate (2010 or above) (Because MSTest is present in that)
  2. Android SDK For Windows (Download Link) (Website link)
  3. Appium For Windows (Download Link) (Website Link)
  4. A Real Android Device running Android 4.2 or Above (I am using an Android Phone running Android 4.3)
  5. A USB Cable to attach your Android Phone to Your PC.
  6. ADB Interface Drivers for your Phone (Link on how to get that ) (very important Step)

Some Configurations for Android SDK and Appium:

  • When you have installed Android SDK, go to My Computer, right click , click Properties, click Advanced System Settings, click Environment Variables.
  • Create a new User Variable with the name "ANDROID_HOME". Give path to your sdk folder in the value. The default path is  C:Program Files (x86)Androidandroid-sdk

  • Edit the PATH variable in "System Variable" Section. Append the path to your tools folder and platform-tools folder. Separated with ";"
The paths are
C:Program Files (x86)Androidandroid-sdktools
C:Program Files (x86)Androidandroid-sdkplatform-tools
See the image below.

  •  Connect your Android Phone with USB Cable. To make sure your android phone is connected with your PC, we have to do following.
Go to C:Program Files (x86)Androidandroid-sdktools. Click on "uiautomatorviewer.bat". A window will open. See Image.

 You can use this window to inspect the elements of your app in android. Open the calculator app in your android device and click on "Device ScreenShot" button on this screen. If you receive this error message "No Android devices were found by adb"

That means adb interface drivers are not installed on your system. You have to read again point number 6 in the Prerequisites section. If android device is successfully connected, you should see a snapshot along with Object Map in this window like this.

  • Unzip in a folder. Open Appium.exe, you should see a window like this.

Click on the android Icon on the top left of this window. You will see a window in which you can configure the platform and version of your android on which you want to test. I have filled the following configurations there.

Now click on the Play button on the top right corner of the window. Appium server will start with the configurations you have provided.

  • Developer options should be enabled on your android phone, with these two options.
Usb Debugging should be enabled.
StayAwake should be enabled.
If you reach till here, Congratulations, You have successfully configured all the required prerequisites .
In the second part, I will show how to code and run this script on your real android device.


  1. Thanks for this - it has been extremely helpful! Just a note, the link to second part (last sentence above) does not link properly. Overall, this has been excellent though!

  2. Thanks a lot man, this was really helpful.

  3. iZombie Season 3 will portray Liv gulping down the brain of a dominatrix. Therefore, we can expect the upcoming installment to be more engaging than the previous ones. iZombie Season 3 Cast

  4. hello!,I like your writing so a lot! percentage we keep in touch more approximately your article on AOL? I need a specialist in this space to unravel my problem. May be that's you! Looking forward to see you. gmail email login

  5. There are many android phones available throughout the world. Many of them have not appeared in North America, however. oukitelcentral

  6. Be that as it may, the receptiveness and its enormous piece of the overall industry made Android helpless against visit security assaults.more information

  7. An open source tool that is required for mobile web, automating Native and hybrid application on Android and IOS platform is known as Appium which was in 2012. Appium is considered to be a cross platform that will low you to write tests which is against multiple platforms like Android and IOS. They do this using the same API. Know More info Click Here:: Appium IOS.

  8. For instance, a binary options investor may look at a company stock that is currently valued at $20 per share and bet $100 that the price will rise to $20.50 or higher by the end of the day.Binary Options Beginners guide

  9. Thanks for the good words! Really appreciated. Great post. I’ve been commenting a lot on a few blogs recently, but I hadn’t thought about my approach until you brought it up. 
    python training institute in marathahalli | python training institute in btm

  10. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    Devops Training courses
    Devops Training in Bangalore
    Best Devops Training in pune
    Devops interview questions and answers

  11. Were a gaggle of volunteers as well as starting off a brand new gumption within a community. Your blog furnished us precious details to be effective on. You've got completed any amazing work!
    Java training in Bangalore | Java training in Rajaji nagar

    Java training in Bangalore | Java training in Marathahalli

    Java training in Bangalore | Java training in Btm layout

    Java training in Bangalore | Java training in Marathahalli

  12. Does your blog have a contact page? I’m having problems locating it but, I’d like to shoot you an email. I’ve got some recommendations for your blog you might be interested in hearing.

    AWS Training in Pune | Best Amazon Web Services Training in Pune

  13. This is beyond doubt a blog significant to follow. You’ve dig up a great deal to say about this topic, and so much awareness. I believe that you recognize how to construct people pay attention to what you have to pronounce, particularly with a concern that’s so vital. I am pleased to suggest this blog.
    Data Science course in rajaji nagar
    Data Science with Python course in chenni
    Data Science course in electronic city
    Data Science course in USA
    Data science course in pune | Data Science Training institute in Pune

  14. You have outdone yourself this time. It is probably the best, most short step by step guide that I have ever seen. Binary Strategy

  15. Thanks for your post. This is excellent information. The list of your blogs is very helpful for those who want to learn, It is amazing!!! You have been helping many application.
    best selenium training in chennai | best selenium training institute in chennai selenium training in chennai | best selenium training in chennai | selenium training in Velachery |

  16. The latest android SDK I have downloaded (for windows system 64 bit) and installed that does not contain Tool and platform_tool folders. Please help

  17. Roulette online is fun as well as skydiving is only safer and free. internet roulette online Win big amounts just now and have nothing to regret.

  18. You are doing a great job. I would like to appreciate your work for good accuracy
    Best Devops Training in Chennai | Best Devops Training Institute in Chennai

  19. Разноцветная светодиодная лента или как ее еще называют светодиодная лента rgb наверое одно из лучших изобретений которое придумали люди, очень забавная штука.

  20. I found a good site, the main thing is that here I am not cheating everything honestly honest play for real money casino I sit play, have fun

  21. This is best one article so far I have read online, I would like to appreciate you for making it very simple and easy
    Devops Training in Chennai | Devops Certification in Chennai


  22. Thank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
    moto g service center in chennai
    motorola service center in velachery
    motorola service center in t nagar

  23. The iPhone countered this via the launch of new phones along with the compulsion to use the iTunes interface to ensure that the phone software was up-to-date. gerald winata gozali

  24. very informative post,thaks foe sharing...
    it support India

  25. A befuddling web diary I visit this blog, it's incredibly grand. Strangely, in this present blog's substance made motivation behind fact and sensible. The substance of information is instructive
    Oracle Fusion Financials Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training

  26. Nice Post! Thank you for sharing knowledge, it was very good post to update my knowledge and improve my skills. keep blogging.
    Java Training in Electronic City

  27. Get the best nursing services baby care services medical equipment services and allso get the physiotherapist at home in Delhi NCR For more information visit our site

    nursing attendant services in Delhi NCR
    medical equipment services in Delhi NCR
    nursing services in Delhi NCR
    physiotherapist at home in Delhi NCR
    baby care services in Delhi NCR

  28. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Devops Training in Electronic City

  29. This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. Binary options recovery

  30. Agarwal Packers and Movers are the best as always but last time I faced little difficulty with them. As one of the staff of them was not doing his job properly. I told him to do things as I am saying but he was ignoring me completely. I even complained about him and later on, they apologize to me and that staff also.

    Agarwal Packers Reviews
    Agarwal Packers Feedback
    Agarwal Packers Complaint

  31. You've made some good points there. I looked on the internet for additional information about the issue and found most people will go along with your views on this website.
    Java Training in Bangalore
    Advanced Java Training in Bangalore

  32. nice blog
    get best placement at VSIPL

    get digital marketing services
    seo network point

  33. This is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points. To appreciate this I like to share some useful information.

    mulesoft training in bangalore

    mulesoft courses in bangalore

    mulesoft classes in bangalore

    mulesoft training institute in bangalore

    mulesoft course syllabus

    best mulesoft training

    mulesoft training centers


  34. click here for more info.

  35. Thanks for sharing the information...
    Best AWS with Devops Training in Bangalore | AWS with Devops Training Course Content | AWS with Devops Training Institutes | AWS with Devops Online Training - Elegant IT Services
    - Elegant IT Services provides Best AWS with Devops Training in Bangalore with expert real-time trainers who are working Professionals with min 8 + years of experience in AWS with Devops Training Industry, we also provide 100% Placement Assistance with Live Projects on AWS with Devops Training.

  36. ftv is a Porn Training site. ftv is the largest Amateur porn training institute with the hottest selection Online and offline real life cam.
    bangla sex video