无法通过 Appium Android 对 tooltip 进行操作 [英] Not able to perform operation on tooltip through Appium Android

查看:18
本文介绍了无法通过 Appium Android 对 tooltip 进行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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),与 toast 通知和 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 中的实现:gist

Here you can find my implementation in Ruby: gist

我使用 2 个 OCR 库,因为两者都有限制:

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

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

想法很简单:

  1. 获取所需的屏幕状态(即显示工具提示)
  2. 制作截图或几张
  3. 处理这些屏幕截图,并查找所需的文本
  4. 获取文本坐标,然后点击它.

希望能帮到你

这篇关于无法通过 Appium Android 对 tooltip 进行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆