想要在 http 响应中捕获一个名为 scanNumber 的变量,如下所示:
{"resultCode":"SUCCESS","errorCode":null,"errorMessage":null,"profile":{"fullName":"TestFirstName TestMiddleName TestLastName","memberships":[{"name":"UA Gold Partner","number":"123-456-123-123","scanNumber":"123-456-123-123"}]}}
我怎样才能通过常规的表达来做到这一点?我正在使用的工具是 Gatling 压力工具(使用 Scala DSL)
我试图这样做:
.check(jsonPath("""${scanNumber}""").saveAs("scanNr")))
但我得到了错误:
---- Errors --------------------------------------------------------------------
> Check extractor resolution crashed: No attribute named 'scanNu 5 (100,0%)
mber' is defined