我在尝试执行get
方法时收到此错误消息。
Validation failed: Values not equal for element '$..userName', expected 'admin' but was '["admin",null,"HiCitrus","Unisys1","dscsc"]'
这是我用过的脚本:
http().client(todoClient)
.send()
.get("/rest/api/user/allusers")
.contentType("application/json");
http().client(todoClient)
.receive()
.response(HttpStatus.OK)
.messageType(MessageType.JSON)
// .validate(path, controlValue);
.validate("$..userName","admin");"
有多个参数可用于用户名 - 有没有办法验证我是否找到了用户名" Admin"?尝试使用下面的代码,但它引发了错误。
.validate("$..userName",contains("admin"));