小编Cle*_* B.的帖子

如何使用 Java 在 UIAutomator 中使用 XY 坐标点击按钮?

我在 Appium/Python 中有:

//calculation max_height
//calculation of max_width
action = TouchAction(self.driver)
action.tap(None, max_width, max_height).release().perform()
Run Code Online (Sandbox Code Playgroud)

我的目标是执行相同的操作,但是在 Java 中使用 UIautomator 工具。我已经尝试了下一个脚本,但它不起作用。

UiObject appButton = new UiObject(new UiSelector());
appButton.click(int x, int y);
Run Code Online (Sandbox Code Playgroud)

我的应用程序是在 Unity 中制作的,并且没有任何定位器的可访问性,因此我必须使用屏幕上的 XY 位置。

有人解决这个问题吗?谢谢。

java android ui-automation android-uiautomator

5
推荐指数
1
解决办法
4588
查看次数