无法通过Appium Android在工具提示上执行操作 [英] Not able to perform operation on tooltip through Appium Android
问题描述
我正在尝试使用Appium自动化android应用程序.我必须在工具提示上执行单击操作,但是appium无法识别工具提示.我已附上以下屏幕截图,其中我必须在"Margaritaville-Grand Turk"上执行点击事件,但是我无法执行此操作.我们如何在工具提示上执行操作.
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.
推荐答案
我是Appium和移动自动化的新手,但是我猜想在活动结构中找不到工具提示(您可以通过Appium检查器进行检查,或UIAutomatorViewer),与吐司通知和AutocompleteTextView
相同.我用OCR图像识别引擎解决了这个问题.
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.
在这里您可以在Ruby中找到我的实现:要点
Here you can find my implementation in Ruby: gist
由于两个方面的限制,我使用了2个OCR库:
I use 2 OCR libs, because of limitation for both:
- ' rtesseract '找不到文本坐标
- ' tesseract '出现文本识别问题
- 'rtesseract' can't find text coordinates
- 'tesseract' have problems with text recognition
想法很简单:
- 获取所需的屏幕状态(即显示工具提示)
- 制作一个或几个截图
- 处理这些屏幕截图,并查找必需的文本
- 获取文本坐标,然后单击它.
希望有帮助
这篇关于无法通过Appium Android在工具提示上执行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!