如何点击UI自动化中只有坐标的按钮?

时间:2015-06-11 12:14:47

标签: javascript instruments ios-ui-automation xcode-instruments

我只有按钮的坐标:

UIAButton:rect:{{253,27},{60,30}}

我存储在一个数组中。我想点击这个按钮,特别是没有给出它的坐标,这样它就是其余按钮的通用。

谢谢。

1 个答案:

答案 0 :(得分:1)

我会做this question中显示的内容。

UIATarget.localTarget().frontMostApp().tapWithOptions({tapCount: 1, tapOffset: {x: 0, y: 0});

您将tapOffset中的零替换为所需的x和y值。