Hello there , I am using follwing line of code to fetch all product name .
List prod_list=driver.findElements(By.xpath("//android.widget.TextView[contains(@resource-id,‘productTitle’)]"));
for (WebElement prolst:prod_list)
{
System.out.println("Name of Product "+prolst.getAttribute(“text”));
}
But its provide me only text for visible element not of that , which are visible when scroll down.
with 162 results you need scroll about 80 times to check all. and it will be many duplicate searches while executing this. but at the end you will get all your 162 results.
public List<String> getAllCellDateValues() {
String currentDate = itemDate.get(0).getText();
String newDate;
List<String> result = new ArrayList<String>();
do {
for (MobileElement el : itemDate) {
if (!result.contains(el)) {
result.add(el.getText());
}
}
swipeList("u");
newDate = itemDate.get(0).getText();
if (newDate.equals(currentDate)) { // let's swipe again for sure
swipeList("u");
newDate = itemDate.get(0).getText();
if (newDate.equals(currentDate)) { // give up
break;
}
}
currentDate = newDate;
} while (true);
return result;
}