Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import java.util.concurrent.TimeUnit;
import org.junit.Test;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
public class AndroidDriverTest1 {
private WebDriver driver = null;
public void shouldSearchWithEbay() {
// And now use this to visit ebay
// Find the text input element by its id
WebElement element = driver.findElement("kw"));
// Enter something to search for
element.sendKeys("Nexus 5");
// Now submit the form. WebDriver will find the form for us from the element
// Check the title of the page
System.out.println("Page title is: " + driver.getTitle());
public void setup() throws Exception {
DesiredCapabilities caps =;
driver = new SelendroidDriver(caps);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
public void teardown() {
if (driver != null) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.