原创

エラーが発生するのはなぜですか: 無効なパラメータが満たされていません: 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.

正文到此结束
热门推荐
本文目录