【发布时间】:2022-08-16 05:22:49
【问题描述】:
我正在尝试滚动我的国家/地区列表以查找特定国家/地区,并且在第一次尝试后列表正在晃动,这会提供错误。
带有应用行为的视频:
https://youtube.com/shorts/6SOI4YQbJlk?feature=share 1
代码:
public void tapOnElementByText(String element) {
HashMap<String, Object> scrollObject = new HashMap<>();
JavascriptExecutor js = driver;
scrollObject.put(\"direction\", \"down\");
js.executeScript(\"mobile: scroll\", scrollObject);
try {
driver.findElementByIosNsPredicate(\"label == \\\"\" + element + \"\\\"\").click();
} catch (NoSuchElementException exception) {
System.out.println(\"Element not found\");
}
}
我尝试了 stackoverflow 和 appium 教程(http://appium.io/docs/en/writing-running-appium/tutorial/swipe-tutorial/)中的各种东西,但对我没有帮助
标签: java ios appium automation-testing