Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Selendroid - Selenium for Android


Published on

Selendroid is an open source test automation framework which drives off the UI of Android native and hybrid applications and the mobile web. Tests are written using the Selenium 2 client API. For testing no modification of app under test is required in order to automate it.

This presentation demonstrates to the audience how easy it is to do mobile test automation. It shows how Selendroid can be used to test native and hybrid Android apps and how the Selenium Grid can be used for parallel testing on multiple devices. Advances topics like extending Selendroid itself at runtime and doing cross platform tests will be covered as well.

Published in: Mobile
  • Be the first to comment

  • Be the first to like this

Selendroid - Selenium for Android

  1. 1. Selendroid - Selenium for Android Dominik Dary Google Test Automation Conference 2014
  2. 2. Who am I? Dominik Dary Engineering Manager @ Twitter: @dominikdary Github: Disclaimer: My Opinions are my own.
  3. 3. Selendroid Open sourced on github: – Documentation: – Main Committers: – eBay, Salesforce and Facebook Getting help – IRC : #selendroid on freenode Android Test Automation
  4. 4. Features – The only mobile WebDriver that supports native & hybrid apps and testing the mobile web on Android versions (API 10 to 19) – Full compatibility with the JSON Wire Protocol. – The app under test must not be modified – No jailbreak / rooting of devices – Interacts simultaneously with multiple Android devices – Supports hot plugging of hardware devices – Advanced Gestures are supported
  5. 5. Testing In Action Native Hybrid Mobile Web WebElement button = driver.findElement("startUserRegistration"));; WebElement nameInput = driver.findElement("inputName")); Assert.assertEquals( nameInput.getText(), "Mr. Burns"); nameInput.clear(); nameInput.sendKeys("GTAC 2014"); // Switch to the web view context driver.context("WEBVIEW"); String vpOfEngineering = "John Williams"; WebElement searchBox = driver.findElement(By.tagName("input")); searchBox.sendKeys(vpOfEngineering); driver.findElement( By.partialLinkText(vpOfEngineering)). click(); WebDriver driver = new RemoteWebDriver(; driver.get(""); WebElement element = driver.findElement("kw")); element.sendKeys("Nexus 6"); element.submit();
  6. 6. Selendroid Inspector • View hierarchy • View UI element properties • UI screenshot with view locator • Record the click actions • View HTML of a web view • XPath helper Demo: Android Test Automation
  7. 7. Multi Touch Support • Single finger example: TouchAction ta = new TouchActionBuilder().pointerDown(). pointerMove(x, y).pointerUp().build(); driver.getMultiTouchScreen().executeAction(ta); • Multi finger example (these will be executed in parallel): TouchAction finger1 = new TouchActionBuilder().pointerDown().pause(100). pointerMove(x, y).pointerUp().build(); TouchAction finger2 = new TouchActionBuilder().pointerDown().pause(100). pointerMove(x, y).pointerUp().build(); MultiTouchAction multiAction = new MultiTouchAction(finger1, finger2); driver.getMultiTouchScreen().executeAction(multiAction);
  8. 8. Extend Selendroid at Runtime • First Mobile Test Automation Project that can be extended with your own code at runtime! • Implement it: • Build it
  9. 9. Use Your Selendroid Extension
  10. 10. Scaling using the Selenium Grid Android Test Automation Client Client GRID Hub server CI server server
  11. 11. There is one more thing We are proud to announce that we have shipped: Selendroid 0.12.0
  12. 12. Thank You! Questions or Comments?
  13. 13. Selendroid in Action – Native Demo: – Hybrid Demo: – Mobile Web Demo: – Selendroid Article: Android Test Automation