无法使用appium点击日历日期,如何点击&;检查
每次在appium inspector中显示此视图时,无法点击日历日期,有任何补救措施吗?您可以点击“按坐标”,并从您的无法使用appium点击日历日期,如何点击&;检查,appium,appium-desktop,Appium,Appium Desktop,每次在appium inspector中显示此视图时,无法点击日历日期,有任何补救措施吗?您可以点击“按坐标”,并从您的AndroidElement获取坐标 public void tapElementByCoordinates(AndroidElement element) { new TouchAction(driver).tap(PointOption.point(element.getCoordinates().onScreen().getX(),element.getC
AndroidElement
获取坐标
public void tapElementByCoordinates(AndroidElement element) {
new TouchAction(driver).tap(PointOption.point(element.getCoordinates().onScreen().getX(),element.getCoordinates().onScreen().getY())).perform();
}
MobileElement calendarButton= (MobileElement) driver.findElement(By.id(“button1”));
new TouchAction(driver).tap(tapOptions().withElement(element(calendarButton))).perform();
使用下面的代码,您只需使用
元素
,即可点击按钮
public void tapElementByCoordinates(AndroidElement element) {
new TouchAction(driver).tap(PointOption.point(element.getCoordinates().onScreen().getX(),element.getCoordinates().onScreen().getY())).perform();
}
MobileElement calendarButton= (MobileElement) driver.findElement(By.id(“button1”));
new TouchAction(driver).tap(tapOptions().withElement(element(calendarButton))).perform();
代码运行得非常好。