首先,需要使用Appium的WebDriverAgent(WDA)驱动来获取“开发者”页面的元素和属性。然后,可以使用以下步骤获取“开发者”页面的坐标:

  1. 打开“开发者”页面并获取其元素。
WebElement developerButton = driver.findElement(By.id("developer_button_id"));
  1. 获取“开发者”页面元素的位置信息。
Point location = developerButton.getLocation();
  1. 获取“开发者”页面元素的大小信息。
Dimension size = developerButton.getSize();
  1. 计算出“开发者”页面元素的中心坐标。
int centerX = location.getX() + size.getWidth() / 2;
int centerY = location.getY() + size.getHeight() / 2;
  1. 将中心坐标返回。
return new Point(centerX, centerY);
``
如何在设置页面用wda驱动获取开发者的坐标?

原文地址: https://www.cveoy.top/t/topic/fWQv 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录