エラーが発生するのはなぜですか: 無効なパラメータが満たされていません: point.x != INFINITY && point.y != INFINITY (Appium モバイル ジェスチャ タップの場合)
温馨提示:
本文最后更新于 2024年04月12日,已超过 48 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我。
I am running a mobile test automation suite using Appium and Java. I have a simple method to find an element and then tap on it.
public void tapElement(WebElement element) {
try {
new WebDriverWait(driver, WAIT).until(ExpectedConditions.refreshed(ExpectedConditions.elementToBeClickable(element)));
} catch (TimeoutException e) {
throw new NoSuchElementException(e.getMessage());
}
if (driver.getClass() == AndroidDriver.class) {
driver.executeScript("mobile: clickGesture", ImmutableMap.of(
"elementId", ((RemoteWebElement) element).getId()
));
} else if (driver.getClass() == IOSDriver.class) {
Map<String, Object> params = new HashMap<>();
params.put("element", ((RemoteWebElement) element).getId());
params.put("x", 1f);
params.put("y", 1f);
driver.executeScript("mobile: tap", params);
}
When running against an iOS app I will randomly get this error org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Invalid parameter not satisfying: point.x != INFINITY && point.y != INFINITY
. Error is thrown at the line driver.executeScript("mobile: tap", params);
It seems to be truly random the same element and the same test will pass one moment and then fail the next. I have tried various x and y parameters but nothing has worked.
Would really appreciate some outside perspective.
正文到此结束
- 本文标签: 家庭宠物
- 本文链接: https://www.coder6.net/article/2468
- 版权声明: 本文由蚂蚁原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
热门推荐
-
浏览(193) 评论(0)