driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()
.scrollable(true).instance(0))
.scrollIntoView(new UiSelector()
.textContains(""+text+"").instance(0))");
此语法适用于元素可见性。我需要一个可以向下滚动到特定维度的语法。
您可以使用以下代码滚动购买,只需提供从(x,y(到(x,y(的坐标
new TouchAction(driver).press(PointOption.point(449,1830)).waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1))).moveTo(PointOption.point(449, 333)).release().perform();