private static void Add_Feed()抛出InterruptedException {
TouchActions action = new TouchActions(driver);
action.press(10, 10);
action.move(50, 50);
action.perform();
Thread.sleep(10000);
由于在Appium中弃用了滑动,我使用此
但错误信息显示为,
java.lang.ClassCastException:io.appium.java_client.android.AndroidDriver无法强制转换为org.openqa.selenium.interactions.HasTouchScreen
答案 0 :(得分:0)
使用此:
new TouchAction(driver).press(startX, startY).waitAction(Duration.ofMillis(duration)).moveTo(endX, endY).release().perform();
确保使用import java.time.Duration;持续时间等级
答案 1 :(得分:0)
new TouchAction(getDriver())
.press(point(startX, startY))
.waitAction(waitOptions(Duration.ofSeconds(1)))
.moveTo(point(startX, endY)).release().perform();