Click on element sometime does not work on Android

I’m testing a mobile application and I have a random issue sometime, on Android only.

I use this keyword to click on a button.

Retry until we can click the element
[Documentation] This keyword retries until we can click the element.
[Arguments] ${locator} ${retry}=15
Retry Until Element Enabled ${locator} ${retry}
Click Element ${locator}

Even if the button is enableb, the click did not works, I stay on the page.

Notice that this only happens right after I activated the app using POST command.

POST Request : url=http://localhost:4723/wd/hub/session/0f881596-a276-4df0-89b1-36e0aba53082/appium/device/activate_app

I suspect the app to not be ready to interact with and I don’t want to implement a sleep. Any idea ?

I would try to implement frame-based element stability check:

  • Wait until element exists
  • After it exists remember its frame
  • Start getting its frame with some reasonable interval/timeout and compare it with the initial one. Continue while these are different

Disabling app animations might also help

I’ll try this one and keep you posted