Appium 急急急:Appium1.5.3 有没有针对 iOS 屏幕滑动的新方法,swipe 坐标滑动已经不支持了,求 Python 语言新解决方法

hardy · 2017年11月15日 · 最后由 hardy 回复于 2017年11月21日 · 1786 次阅读

使用 Appium1.5.3 做 iOS 自动化,在实现屏幕滑动的时候,发现 swipe 已经不支持 iOS 的坐标滑动,上网查询了一些方法,execute_script 和 scroll 好像是 java 语言的,现在使用的是 Python 写的自动化,求告知 iOS 的屏幕滑动解决方法。邮箱:877892385@qq.com

共收到 5 条回复 时间 点赞

楼主解决没有,Appium 1.7 的 swipe 也有问题

TouchAction(self.driver).press(x=657, y=1557).move_to(x=4, y=-724).release().perform()

def __do_swipe(self,x1,y1,x2,y2,duration=0.5):
        self.driver.execute_script("mobile: dragFromToForDuration",{"fromX": x1, "fromY": y1, "toX": x2, "toY": y2, "duration": duration})


John 回复

已经解决了,使用 driver.execute_script('mobile:scroll', {'direction': '参数'}) 参数:down,up,right,left

hardy 关闭了讨论 11月21日 16:06
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册