51Testing软件测试论坛

标题: JSON Path断言报错 [打印本页]

作者: liuheng1    时间: 2017-2-21 18:18
标题: JSON Path断言报错
接口响应结果为{"content":{"appList":[
{"appSummary":{"appName":"智能厅堂系统","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70466},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"综合柜面系统","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70512},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"综合业务系统","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70211},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"规则引擎","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70219},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"PE流程引擎","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70221},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"旧版网上银行系统","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70355},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"微信银行系统","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70373},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"电话银行系统","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70391},"attention":false,"healthDegree":100},
{"appSummary":{"appName":"村镇银行综合业务系统","categoryId":1001002,"groupId":1,"groupName":"综合业务","l1CateName":"应用群组","l2CateName":"生产应用系统","l3CateName":"规划类","objectId":70327},"attention":false,"healthDegree":100}]},"status":true}
JSON Path断言:

JSONPath断言结果为:Missing property in path $['appList']。
感觉是断言里面的jsonpath写的有问题,咋改

作者: liuheng1    时间: 2017-2-22 09:35
自己检讨JSON PATH写错了,应该为:$.content.appList[0].appSummary.appName
作者: 梦想家    时间: 2017-2-22 09:48
liuheng1 发表于 2017-2-22 09:35
自己检讨JSON PATH写错了,应该为:$.content.appList[0].appSummary.appName

厉害了 自己找到自己的问题了
作者: kz东方    时间: 2018-2-4 14:30
我感觉这种错误,应该很快能发现,还要发一下帖子么
作者: lsc9263a    时间: 2018-5-31 12:57
自己检讨JSON PATH写错了




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2