I want to check that the userid I am requesting is being returned in the response (json)
I guess I have to use .check(jsonPath("$. is like ${userID}.
My json response is below and I want to check that the “number”: “123”
`
1. {
1. "resultCode": "SUCCESS",
1. "errorCode": null,
1. "errorMessage": null,
1. "profile":
1. {
1. "id": "555555555",
1. "fullName": "Jason Xeml",
1. "memberships":
1. [
1. {
1. "name": "thename",
1. "number": "123",
1. "scanNumber": "555-555-555-555"
1. }
1. ]
1. }
1. }
`
is equivalent to the ${userID} below:
`
.exec(
http(“getUser”)
.get("/user/account")
.header( “X-Token”, “${userID}” )
.check(status.is(200))
.check(jsonPath("$.resultCode").is(“SUCCESS”))
.check(jsonPath("$.profile.memberships[0].number" = “${userID}” )
or:
.check(jsonPath("$.profile.memberships[0].number" equals “${userID}” )
or?.. how?
)
`
I think the first part “$.profile.memberships[0].number” works, but how do I say that is must be equivalent to the requests ${userID} ?
using equals? using = or how?
Magnus