Clicking/Tapping element that is not clickable

Hi,

I’m having some issues with interacting with a button. The click method wasn’t working, so I saw that it is actually not clickable. However, manually you can click it. So, I turned my focus into tapping the element using w3c actions. I have trying everything that I have found, however nothing worked. Can you help me?

The element’s attributes from Appium Inspector:

The method that I have implemented in order to tap the element:


    public void tapElement(WebElement element){
        Rectangle elRect = element.getRect();
        Point point = new Point(elRect.x, elRect.y);
        PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
        Sequence tap = new Sequence(finger, 0);
        tap.addAction(finger.createPointerMove(Duration.ofMillis(0), PointerInput.Origin.viewport(), point.x, point.y));
        tap.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg()));
        tap.addAction(finger.createPointerMove(Duration.ofMillis(50), PointerInput.Origin.viewport(), point.x, point.y));
        tap.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg()));

        getDriver().perform(List.of(tap));
    }
  1. Replace Sequence tap = new Sequence(finger, 0);Sequence tap = new Sequence(finger, 1);
  2. enable on phone in debugger menu show touches and coordinates to see where tap actually happens

o! You trying tap on element left upper corner. Quite often it does not work. Tap on CENTER of element!

Point point = new Point(rectangle.x + (rectangle.width / 2), rectangle.y + (rectangle.height / 2));

It didn’t worked. Also, I saw that it taps the correct element