Configuring Android WebDriver in Eclipse
Configuring AndroidDriver in Eclipse
1- Download Android server apk from this URL https://code.google.com/p/selenium/downloads/list
2- Download android SDK from this location
http://developer.android.com/sdk/index.html
3- Unzip it in some location like C:/SDK
4- You will see three folder ther
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
- a. By using command line (navigate to platform tool location)emulator -avd my_android &
- 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.
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.
Thank you for your suggestion for correction, I would like to listen more correction suggestion from you in future.
Thank you
You are welcome
At number 11: adb -s emulator-5554 forward tcp:8080 tcp:808
It would be 8080 at last word of line
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/