You are on page 1of 2

1. JDK (Ensure the JAVA_HOME is set) 2. Download Android SDK ADT bundle for windows from http://developer.android.com /sdk/index.

html (510MB size-file name->adt-bundle-windows-x86_64-20140321.zip) 3. Copy to D: drive and unzip it; u get a folder-adt-bundle-windows-x86_64-20140 321 4. in "PATH" variable add following paths D:\adt-bundle-windows-x86_64-20140321\sdk D:\adt-bundle-windows-x86_64-20140321\sdk\platform-tools D:\adt-bundle-windows-x86_64-20140321\sdk\tools 5. Create new environment variable "ANDROID_HOME" with the value "D:\adt-bundlewindows-x86_64-20140321\sdk" 6. download Test app from search.maven.org/remotecontent?filepath=io/selendroid/selendroid-test-app/0.9.0/ selendroid-test-app-0.9.0.apk copy it to D: drive (file name is selendroid-test-app-0.9.0.apk) 7. download selendroid jar from https://github.com/selendroid/selendroid/releases/download/0.9.0/selendroid-stan dalone-0.9.0-with-dependencies.jar Copy the jar file to D: drive 8. open the cmd and type d: press enter 9. type following cmd and press enter which creates a file "resigned-selendroidtest-app-0.9.0.apk" in D: java -jar selendroid-standalone-0.9.0-with-dependencies.jar -app selendroid-test -app-0.9.0.apk 10. download and install bluestacks player from http://www.bluestacks.com/app-pl ayer.html 11. Open BlueStacks using "Start BlueStacks" (short cut on desktop) 12. Right Click on newly created file "resigned-selendroid-test-app-0.9.0.apk" p resent in D: select "Open with Bluestacks APK installer" which will install the test app in Bluestacks 13. Open cmd and type "adb connect 127.0.0.1:5555" press enter 14. Open Eclipse IDE (use new Javaproject) 15. Associate selendroid-standalone-0.9.0-with-dependencies.jar file present in D: driver to new Java project 16. write following code in Demo.Java import io.selendroid.SelendroidCapabilities; import io.selendroid.SelendroidConfiguration; import io.selendroid.SelendroidDriver; import io.selendroid.SelendroidLauncher; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; public class Demo { public static void main(String[] args) throws Exception {

SelendroidLauncher selendroidServer = null; WebDriver driver = null; SelendroidConfiguration config = new SelendroidConfiguration(); config.addSupportedApp("selendroid-test-app-0.9.0.apk"); selendroidServer = new SelendroidLauncher(config); selendroidServer.lauchSelendroid(); SelendroidCapabilities caps = new SelendroidCapabilities("io.selendroid.testapp:0.9.0"); driver = new SelendroidDriver(caps); WebElement inputField = driver.findElement(By.id("my_text_field")); inputField.sendKeys("Bhanu"); if (driver != null) { driver.quit(); } if (selendroidServer != null) { selendroidServer.stopSelendroid(); } } } 17. Run it; Enjoy!

You might also like