Configuring Android WebDriver in Eclipse

Configuring  AndroidDriver in Eclipse

1-      Download  Android server apk from this URL https://code.google.com/p/selenium/downloads/listandroid-apk

2-   Download android SDK from this location
http://developer.android.com/sdk/index.htmlandroid-sdk





3-      Unzip it in some location like C:/SDK

4-      You will see three folder ther

  •  Eclipse
  • SDK Manager.exe
  • sdksdk

Like this

 

Here you can use the eclise from here and so no need to configure here in eclipse it is already there in eclipse

Now you need to Create Android Virtual Device

Go to  Window >>AVD Manager>>




or

5-      Avd can also be created by command line
But for that you need to reach to the directory path of <sdk> tools
so open you Command prompt write this line (as my tools is present at this location)
cd C:androidadt-bundle-windows-x86sdktools
now write this line

android create avd -n my_android -t 14 -c 512M

Here  -n stands for specification of the avd name
-t  is used here for It specifies the platform target. Use the android list targets command to get the list of platforms available with the SDK.
-c  targets to SD card in mobile

6-      Lauching emulator

  1. a.       By using command line (navigate to platform tool location)emulator -avd my_android &    launching-emulator
  2. b.      By using manually
    Window >>Android Virtual Device Manager >> select already created AVD and click on start

7-      Finding  device id (I am assuming that we are in platform-tools directory on CMD)
write this command in CMD
adb devices    By default it will give id like this emulator-5554




8-      Now  copy your androidDriver apk and place it in platform-tools folder

9-      Now installing the apk in  newly created AVD(assuming that we are in platform-tools directory in cmd)
adb -s emulator-5554 -e install -r  android-server-2.21.0.apk

10-   Starting  Android-server (assuming we are in platform-tools directory on CMD)
adb -s emulator-5554 shell am start -a android.intent.action.MAIN -n org.openqa.selenium.android.app/.MainActivity -e debug true

11-   Setting up the port forwarding in order to forward traffic or script injection from local machine to emulator

adb -s emulator-5554 forward tcp:8080 tcp:808

But if you want to install plug-in of Android WebDriver in to your eclipse 
Steps:

1- Go to Help>> Install new software >> Add
https://dl-ssl.google.com/android/eclipse/

and Follow the instruction and finally you would be able to configure the Android WebDriver   plugin in Eclipse.

Dwarika Dhish Mishra

My name is Dwarika Dhish Mishra, its just my name and I am trying to bring the worth of my name in to actions and wants to be the solution not the problem. I believe in spreading knowledge and happiness. More over I am fun loving person and like travelling a lot. By nature I am a tester and a solution maker. I believe in the tag line of http://ted.org “Idea worth spreading” . For the same, I have created this blog to bring more and more learning to tester fraternity through day to day learning in professional and personal life. All contents are the part of my learning and so are available for all..So please spread the contents as much as you can at your end so that it could reach to every needful people in testing fraternity. I am pretty happy that more and more people are showing interest to become the part your Abode QA blog and I think this is good sign for us all because more and more content would be before you to read and to cherish. You may write or call me at my Email id: dwarika1987@gmail.com Cell: 9999978609

You may also like...

8 Responses

  1. Ripon Al Wasim says:

    To create Android Virtual Device (AVD):
    avd can also be created by command line. For this you need to go to the following folder:
    cd C:androidadt-bundle-windows-x86sdktools

    But in this document it is written as: cd C:androidadt-bundle-windows-x86sdkplatform-tools
    You are requested to correct it.

  2. Ripon Al Wasim says:

    At number 11: adb -s emulator-5554 forward tcp:8080 tcp:808
    It would be 8080 at last word of line

  3. Vinay Sharma says:

    Would we have to install going through cmd, or it is sufficient to install plugin going through URL

    https://dl-ssl.google.com/android/eclipse/

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.