I'm trying to get the items from a ListView so I can compare them with of expected results. The thing is that I can't figure out how to get those Elements.
I'm also the developer of the App, so I'm using the ID that I assigned to that element to identify it.
Here is the code that I have right now:
public String playersListItem(int n){
//waitElement(driver.findElement(By.id("playersList")));
List<WebElement> players = driver.findElements(By.id("playersList"));
return players.get(n).getText();
}
I'm comparing playersListItem(0) with "Jones" but the item in the position 0 is always blank.
this is the reason of the fail that I get in the Assert:
java.lang.AssertionError: expected [Jones] but found []