Unbale to get the element from the UI

Hi All…
I would be need to identify the element for the widget button which doesn’t have attributes such as id, text

and index is not identifiable… please look in to the attached screen shot and let me know please how to identify the button(’+’) with available

Appreciate for the support

Thanks

Hi,

Since this is the last ImageButton on the screen, try finding the list of all ImageButtons, get its size and then use get(index) method to click on the last index.

List<WebElement> imgList = driver.findElements(By.xpath(//ImageButton));
int listSize = imgList.size();

//Click
imgList.get(listSize - 1).click();
1 Like

try this xpath
driver.findElement(By.xpath("//android.widget.ImageButton[@index=‘4’]"))