Appium appium ios 在 进行 Click () 的时候报错,提示:undefined status object

王先生 · 2015年11月05日 · 最后由 thl1207 回复于 2016年03月04日 · 1323 次阅读

各程序版本信息:

(Appium 版本:1.4.13,ios 版本:4s 9.1 mac 版本:10.10.5,Xcode 版本:7.1)

Appium 的 Debug 信息如下:

Error: invalid json

    at parse (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/body-parser/lib/types/json.js:79:15)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/body-parser/lib/read.js:102:18

    at done (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/body-parser/node_modules/raw-body/index.js:248:14)

    at IncomingMessage.onEnd (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/body-parser/node_modules/raw-body/index.js:294:7)

    at IncomingMessage.g (events.js:199:16)

    at IncomingMessage.emit (events.js:104:17)

    at _stream_readable.js:908:16

    at process._tickDomainCallback (node.js:381:11)

info: [debug] Socket data being routed.

info: [debug] Got result from instruments: {"status":0,"value":{"origin":{"x":16,"y":192},"size":{"width":288,"height":48}}}

info: <-- POST /tap 500 1.069 ms - 66

info: [debug] Responding to client with error: {"status":1,"value":{"message":"undefined status object"},"sessionId":"fd36b327-11d8-4f17-87ff-81521b8b4ba9"}

info: <-- POST /wd/hub/session/fd36b327-11d8-4f17-87ff-81521b8b4ba9/element/0/click 500 1048.807 ms - 109 

共收到 10 条回复 时间 点赞

@lihuazhang 标题已经修改,请审核

#1 楼 @wanglha 排版格式。使用 markdown,使用代码块。

@lihuazhang 已经重新排版,请审核!

@wanglha 王先森,只有一个错误的 message,还有其他的细节吗?

@lihuazhang 没有了就这些信息,我现在发现可能最主要的问题就是这个 “info: <-- POST /tap 500 1.069 ms - 66” 为什么 post 后面是个 500 的错误呢。这个 500 在 appium 的 debug 信息输出平台上显示的红色的。

#5 楼 @wanglha 上下文都描述下,要做什么。

@lihuazhang @monkey
使用 click() 方法点击登录按钮程序报错,方法如下:

driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAButton[5]")).click();

使用 tap() 方法可以实现点击登录按钮操作,方法如下:

driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAButton[5]")).tap(16, 192);

请问为什么 click() 方法无法使用,app 截图如下:

试试 precise tap 吧

hi,楼主及各位大神,我是新手,目前正准备在 OS X 上搭建 Appium 环境,有比较新比较详细的搭建和入门使用文档吗?求给我一份,谢谢啦!

#9 楼 @zhuquan0814 哥们问题搞定没

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