Unable to click on a element when it has two elemnts in same accordion

Hey guys , i am working on writing java scripts for ui automating the app.in our application we have both expand button and Add button in same accordion so unable to click on a Add button .can any one help me out of this11

what is it? same id? or …

for both expand and Add button it is showing same Details so when i tries to click on Add button it expanding

you can find list of elements and tap on first = Expand, second = Add.
Fail = show us more details.


use better tap by coordinates. get element. get it location X,Y. get it width and height. Now calculate:

  • Expand: x + h/2 , y + w*0.1
  • Add: x + h/2 , y + w*0.9

Or ask Android developer for help to show these buttons in UI.

csn u send me the any example code for it i didnt get it

Rectangle rectangle = el.getRect();
int x = ?; // TODO: x + (width / 10) = beginning left part, x + (width * 9 / 10) = end right part of rectange
int y = rectangle.y + (rectangle.getHeight() / 2); // center of rectangle
PointOption pointOption = new PointOption().withCoordinates(x, y);
new TouchAction(driver).tap(pointOption).perform();