有没有办法在Android上使用Appium执行双击?



我已经尝试了我能想到的所有TouchActions和链接的组合,使用Appium集成测试框架在Android上执行双击。我只能录下一次录音。下面是我希望能够工作的(Java)代码:

new TouchAction(driver).tap(x, y).tap(0, 0).perform();

有没有人有一个工作的Android代码样本来分享?

作为参考,在iOS中,以下(Python)代码似乎确实会产生双击:

wd = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
...
wd.tap([(215, 315)])
wd.tap([(215, 315)])
time.sleep(1)

尝试:

action = TouchAction(self.driver)
action.tap(element=None, x=100, y=600, count=2).perform()

或有元素而不含x, y坐标

(你必须导入:"from appium.webdriver.common.touch_action import TouchAction")

使用x,y坐标双击Appium java:

new TouchAction(driver).press(PointOption.point(328, 185)).release().perform().press(PointOption.point(338, 185)).release().perform();

尝试这个appium手势与UiAutomator2自动移动手势

MobileElement button = driver.findElement(By.id(" button "));

((JavascriptExecutor) driver).executeScript("mobile: doubleClickGesture", ImmutableMap.of("elementId",((MobileElement)button).getId()));

TouchAction = new TouchAction(Driver);

行动。水龙头(x, y) .Wait(100)。水龙头(x, y) .Perform ();

最新更新