Hi,
I am trying find an element from a Dropdown list in an Hybrid App and not able to scroll the Dropdown list. Below is my code,
public static Boolean selectByText( AndroidDriver driver,String text,String path,String object) throws InterruptedException {
MobileElement dropDown = driver.findElement( By.cssSelector(path) );
System.out.println(dropDown);
dropDown.click();
Thread.sleep(1000);
List Allvalues=dropDown.findElements(By.cssSelector(object));
System.out.println(Allvalues);
for (MobileElement we: Allvalues) {
dropDown.sendKeys( Keys.DOWN );
Thread.sleep(10000);
if (we.getText().contains( text ) ) {
dropDown.findElement(By.xpath(object)).click();
return true;
}
I am giving the Element Xpath value in “object” parameter. Please help me how to scroll the dropdown and identify the object from the list
Thanks