Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
298 views
by The go-to Tester (473 points)
In android app testing, how to find element  to use in script?

1 Answer

0 like 0 dislike
by The go-to Tester (142 points)

Identifying an element in Selendroid is same as in Selenium.

Sample code from the official website,

SelendroidCapabilities capa = new SelendroidCapabilities("io.selendroid.testapp:0.17.0");

WebDriver driver = new SelendroidDriver(capa);
WebElement inputField = driver.findElement(By.id("my_text_field"));
Assert.assertEquals("true", inputField.getAttribute("enabled"));
inputField.sendKeys("Selendroid");
Assert.assertEquals("Selendroid", inputField.getText());
driver.quit();

Apart from id, you can use className, linkedText, partialLinkedText, name, tagName, xpath, cssSelector like in Selenium.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...