Hi guys
I have this problem with an app,
As a part of a test, I am in a screen where is structure alredy defined, but when I click a spinner object, the structure changes completely and loads only one object (a ListView), so, my problem is when I want to select an item from this ListView it takes like a one minute, so it’s very slow.
I've been trying with:
//takes 30 seconds to click`
`appdriver.findElementByXPath("//*[@text=\""+data1+"\"]").click();
or
//takes like 60 seconds to click
this.appdriver.findElement(MobileBy
.AndroidUIAutomator(“new UiScrollable(new UiSelector()).scrollIntoView(”
+ “new UiSelector().text(”"+data1+""));")).click();
or
// takes more than 30 seconds to click
List<MobileElement> list1= appdriver.findElements(By.xpath("//android.widget.ListView[1]/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.TextView"));
for(int i=0 ; i< list1.size(); i++) {
if(list1.get(i).getText().toString().trim().compareTo(data1)==0) {
list1.get(i).click();
break;
}
}
PD: The Listview, doesn’t have an ID either resource ID.
Any idea?