Not able to perform operation on tooltip through Appium Android

荒凉一梦 提交于 2019-12-12 04:39:47

问题


I am trying to automate android application with Appium. I have to perform click operation on tooltip but appium does not identify the tooltip. I have attached screenshot below in which i have to perform click event on "Margaritaville-Grand Turk" but i am not able to perform this operation. How way we can perform action on tooltip.


回答1:


I'm new to Appium, and mobile automation, but I could guess that tooltip is could not be found in activity structure (you could check with Appium inspector, or UIAutomatorViewer), same problem with toast notifications and AutocompleteTextView. I solve this with OCR image recognition engine.

Here you can find my implementation in Ruby: gist

I use 2 OCR libs, because of limitation for both:

  • 'rtesseract' can't find text coordinates
  • 'tesseract' have problems with text recognition

Idea is simple:

  1. get required screen state(i.e. tooltip is shown)
  2. make screenshot or few
  3. process these screenshots, and look for required text
  4. get text coordinates, and click on it.

Hope it helps



来源:https://stackoverflow.com/questions/30211827/not-able-to-perform-operation-on-tooltip-through-appium-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!