var responsebody = pm.response.json()
var new1="[contact]"
var new2= "[address]"
var new 3 ="[city]"
int i =0;
var data="responsebody[i]"
var newdata = data+new1+new2+new3
This is not working:
pm.expect(newdata).to.equals("New York");
Issue is showing Assertion response[i][new1][new2][new3]
is not equal to (“New York”)
But this is working -
pm.expect(response[i].[new1].[new2].[new3]).to.equals("New York");
Can we change this string value?
"response[i][new1][new2][new3]" into object and pass to pm.expect(); so that extract response value
need to create this string dynamically .