上的按钮不UIAutomation工作轻按命令 [英] Tap command on a button not working in UIAutomation

查看:392
本文介绍了上的按钮不UIAutomation工作轻按命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序这个按钮。我想模拟按钮自来水。该按钮位于如下:目标> frontMostApp()>窗口()[0]>按钮()[2]。我的javascript code如下:
target.frontMostApp(窗口)()[0] .buttons()[2] .tap();
但在运行code后,将显示以下错误消息:

I have this button in an app. I want to simulate a tap on the button. The button is located as follows: target>frontMostApp()>windows()[0]>buttons()[2]. My javascript code is as follows: target.frontMostApp().windows()[0].buttons()[2].tap(); But after running the code, the following error message is shown:

错误:target.frontMostApp(窗口)()[0] .buttons()[2]不能被窃听

Error: target.frontMostApp().windows()[0].buttons()[2] could not be tapped

我已经检查这个按钮的可访问性标签设置为启用。谁能告诉我什么,我做错了什么?下面是仪器控制台的屏幕截图:

I have checked that the accessibility label of this button is set to enabled. Can anyone tell me what I am doing wrong? Below is a screenshot from the instruments console:

突出显示的按钮是按钮,我想挖。

The highlighted button is the button I would like to tap.

推荐答案

您可以运行 logElementTree()在窗口上并粘贴在你的问题?这个错误通常意味着你正在寻找的元素无效。也许我们可以帮助发现通过在元素树一起看这个问题。

Can you run logElementTree() on the window and paste that in to your question? That error usually means that the element you are looking for isn't valid. Maybe we can help discover the problem by looking at the element tree together.

这篇关于上的按钮不UIAutomation工作轻按命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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