Appium driver 报错: Method is not implemented 死因:使用官方 api:double_tap

pan · 2018年10月16日 · 最后由 紫殇情结 回复于 2020年12月08日 · 2642 次阅读

今天看官方 API 的时候发现一个 double_tap,刚好再想如何封装双击操作,然后用了下,随后报错 WebDriverException: Message: Method is not implemented😲

使用 python 客户端 Appium-Python-Client
代码如下:

from selenium.webdriver.common.touch_actions import TouchActions
el = self.driver.find_element_by_id(element)
TouchActions(self.driver).double_tap(el).release(coordinate_x, coordinate_y).perform()

appium 日志

[HTTP] --> POST /wd/hub/session/ae4b93cb-eb8a-44f7-95ad-135a7bdb42b2/touch/doubleclick
[HTTP] {“sessionId”:“ae4b93cb-eb8a-44f7-95ad-135a7bdb42b2”,“element”:“7”}
[debug] [W3C] Encountered internal error running command: NotImplementedError: Method is not implemented
[debug] [W3C] at asyncHandler$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:277:15)
[debug] [W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [W3C] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[debug] [W3C] at new Promise ()
[debug] [W3C] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[debug] [W3C] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[debug] [W3C] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [W3C] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[debug] [W3C] at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/build/lib/protocol/protocol.js:380:32)
[debug] [W3C] at /usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:446:15
[debug] [W3C] at Layer.handle [as handle_request] (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [W3C] at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:137:13)
[debug] [W3C] at Route.dispatch (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:112:3)
[debug] [W3C] at Layer.handle [as handle_request] (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [W3C] at /usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:281:22
[debug] [W3C] at param (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:354:14)
[debug] [W3C] at param (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:365:14)
[debug] [W3C] at Function.process_params (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:410:3)
[debug] [W3C] at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[debug] [W3C] at logger (/usr/local/lib/node_modules/appium/node_modules/morgan/index.js:144:5)
[debug] [W3C] at Layer.handle [as handle_request] (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/layer.js:95:5)
[debug] [W3C] at trim_prefix (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:317:13)
[debug] [W3C] at /usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:284:7
[debug] [W3C] at Function.process_params (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:335:12)
[debug] [W3C] at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:275:10)
[debug] [W3C] at /usr/local/lib/node_modules/appium/node_modules/body-parser/lib/read.js:130:5
[debug] [W3C] at invokeCallback (/usr/local/lib/node_modules/appium/node_modules/raw-body/index.js:224:16)
[debug] [W3C] at done (/usr/local/lib/node_modules/appium/node_modules/raw-body/index.js:213:7)
[debug] [W3C] at IncomingMessage.onEnd (/usr/local/lib/node_modules/appium/node_modules/raw-body/index.js:273:7)
[debug] [W3C] at IncomingMessage.emit (events.js:180:13)
[debug] [W3C] at endReadableNT (_stream_readable.js:1106:12)
[debug] [W3C] at process._tickCallback (internal/process/next_tick.js:114:19)
[HTTP] <-- POST /wd/hub/session/ae4b93cb-eb8a-44f7-95ad-135a7bdb42b2/touch/doubleclick 405 30 ms - 3812
共收到 2 条回复 时间 点赞

亲,最后怎么解决的?我现在也遇到相同的问题了 我的系统环境是 osx

我也遇到同样问题了,该怎么解决呢?

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册