Hi all,
It think its too late to reply.. i was just going through all the queries and i too faced this issue... And i solved it using below code..
Hope it might help any1...
String a = "Last element name"; /// last element in the list
Boolean found = false;
while (!found){
List<WebElement> ele = driver.findElements(By.id(""));
int size=0;
size = size+ele.size();
for (int i = 0; i < size; i++) {
String s;
s = songs.get(i).getText();
if (s.equals(a)) {
found =true;
system.out.println(size);
break;
}
}
if(!found){
driver.swipe(startx, starty, endx, endy, duration);}
}
Thanks,
Sudhanva.M