问答 iOS+appium+python 使用 swipe 时报错。求大神指点指点。

77 · 2018年05月29日 · 最后由 77 回复于 2018年05月30日 · 1526 次阅读

iOS+appium+python 使用 swipe 时报错。

环境: os 10.13.4
Xcode: 9.3.1
appium -v 1.7.2

同样的代码在 Android 设备上没问题,执行在 iOS 设备上时报错。

代码:

在代码中使用 swipe 时报错:

【报错内容】
Traceback (most recent call last):
File "/Users/qinqin/Desktop/sample-code-master/huadong/ss.py", line 91, in
.move_to(x=483, y=0).wait(100).release().perform()
File "build/bdist.macosx-10.5-fat/egg/appium/webdriver/common/touch_action.py", line 94, in perform
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "build/bdist.macosx-10.5-fat/egg/appium/webdriver/errorhandler.py", line 29, in check_response
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Unhandled endpoint: /session/21C8B102-1FDB-4310-A888-7798CB857862/wda/touch/perform -- http://localhost:8100/ with parameters {
wildcards = (
"session/21C8B102-1FDB-4310-A888-7798CB857862/wda/touch/perform"
);
}

appium 报错

最佳回复
77 #1 · 2018年05月30日 Author

找到解决方法了:

self.driver.execute_script("mobile: scroll", {"direction": "down"})

共收到 3 条回复 时间 点赞

IOS 建议不用 swipe 函数,高版本使用不好使

77 #3 · 2018年05月30日 Author
笑哼 回复

有什么好方法么,求介绍。

77 #1 · 2018年05月30日 Author

找到解决方法了:

self.driver.execute_script("mobile: scroll", {"direction": "down"})

77 关闭了讨论 05月30日 17:23
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册