我无法使用 Appium 向下滚动到 Android 应用程序中任何页面的底部。尝试了多种方法,包括在 Stack Overflow 上找到的方法。(这个挑战似乎很常见。)然而,所有的尝试都失败了。
环境:
System.out.println(driver.getContext());,结果是NATIVE_APP请分享可以解决此问题的任何替代方案或改进。非常感谢任何有用的建议!
以下总结了尝试的各种方法:
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(resourceId(\"send-to-email-app\"));").click();
try {
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(text(\"Send\"))");
}catch(Exception e) {
System.out.println("We got an error scrolling!");
}
driver.swipe(0, Startpoint,0,scrollEnd,1000);
...touchAction.longPress(fromX, fromY).moveTo(toX, toY).release().perform();
TouchAction touchAction = new TouchAction(driver);
touchAction.longPress(10, 10).moveTo(x, y).release().perform();