首页 文章

使用Appium Selenium iOS进行自动测试

提问于
浏览
0

我开发了iPhone,Selenium和Appium的自动化测试 . 我需要在当前屏幕位置上执行触摸操作 .

你能帮助我吗?你有任何示例代码吗?我检查了这个解决方案,但它不起作用

new TouchActions(wd).down(0, 0).move(150, 0).perform();

2 回答

  • 0

    尝试以这种方式使用TouchAction类:

    TouchAction action = new TouchAction();
    action.longPress(webElement).moveTo(webElement).release().perform();
    
  • 0
    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();
    

相关问题