Java 使用Appium Selenium iOS进行自动测试
我用iPhone、Selenium和Appium开发了自动测试。我需要在当前屏幕位置执行触摸操作 你能帮我吗?您有任何示例代码吗?我检查了这个解决方案,但它不起作用Java 使用Appium Selenium iOS进行自动测试,java,ios,selenium,junit,appium,Java,Ios,Selenium,Junit,Appium,我用iPhone、Selenium和Appium开发了自动测试。我需要在当前屏幕位置执行触摸操作 你能帮我吗?您有任何示例代码吗?我检查了这个解决方案,但它不起作用 new TouchActions(wd).down(0, 0).move(150, 0).perform(); 尝试以下方式使用TouchAction类: TouchAction action = new TouchAction(); action.longPress(webElement).moveTo(webElement).
new TouchActions(wd).down(0, 0).move(150, 0).perform();
尝试以下方式使用TouchAction类:
TouchAction action = new TouchAction();
action.longPress(webElement).moveTo(webElement).release().perform();
你想表演什么?要向下滚动或其他操作吗?我想执行Tap如何创建另一个操作?当我创建另一个操作时,我收到了错误消息。执行用户提供的JavaScript时出错。
TouchAction touchAction = new TouchAction(appiumDriver);
System.out.println(startx+" "+starty);
System.out.println("Entering swipe");
System.out.println("Swipe from "+startx +" " +starty +"to" +endx +" " +endy );
touchAction.press(startx, starty).waitAction(duration).moveTo(endx,endy).release().perform();