Failed to perform operation on tooltip via Appium Android
I am trying to automate an android application with Appium. I need to perform a click operation on the tooltip, but appium does not identify the tooltip. I have added the screenshot below where I need to execute a click event on "Margaritaville-Grand Turk" but I cannot do this. How can we perform actions on the tooltip.
source to share
I'm new to Appium and mobile automate, but I could guess that the tooltip can be found in the structure of activity (you can check by using Appium or UIAutomatorViewer Inspector), the same problem with notifications on toast and AutocompleteTextView
. I solve this with the OCR image recognition engine.
You can find my implementation in Ruby here: gist
I am using 2 OCR libs, due to limitations for both:
- ' rtesseract ' cannot find text coordinates
- ' tesseract ' have OCR problems
The idea is simple:
- get the required screen state (for example, a prompt is shown)
- take a screenshot or several
- process these screenshots and search for the required text
- get text coordinates and click on it.
Hope it helps
source to share