Hello, I ran into the problem of finding elements on a page using the image search method.
When using the findElementByImage method, the appium finds only one element that matches the provided template, even if there are several such elements on the page. I need to find all these elements that are similar to each other. To do this, I used the findElementsByImage method, which searches for all the same elements on the page and enters them into a List. But for some reason this method does not work for me. When using the findElementsByImage method, only one first element is determined anyway, ending at this search, all other elements of the same with the same image are disregarded. How can you find a solution to this problem?
My method for find this elements:
public ImageSelector findAllViolations() throws IOException { driver.setSetting(Setting.IMAGE_MATCH_THRESHOLD, 0.68); List<MobileElement> elementsOne = driver.findElementsByImage(findViolation()); for (MobileElement violation : elementsOne) { log.info(violation.getAttribute("score")); log.info("Count images: "+elementsOne.size()); } saveScreenshot(((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES)); log.info("Violation found!"); return this; }