0
votes

I've been trying to figure out how to configure a simple JSON Path extractor (provided on jmeter-plugins) and where to put it (inside an Http sample, outside...)

Http requests

As you can see, ${expiredaccesstokenerror} is empty.

In order to fill this variable, I'm trying to extract a vallue from body response:

enter image description here

As you can see I'm trying to extract from json body content like:

{
    "error_description":"Access token expired",
    "suberror":"expired_accesstoken",
    "error":"invalid_grant"
}

So, I've set JSON extractor for extracting $.suberror, however, it's always empty.

1
looks ok, but 2 things to check: any errors in jmeter.log and if you set "default value" to something like "NOT FOUND", will it be that default value or still empty? (in first case it means it doesn't parse json properly, in second case it would mean post-processor is not running at all.)Kiril S.
one more thing: since your json is pretty simple, you could try to run Regular Expression Extractor with Regex=suberror":"(.*)",, template=$1$ and match=1. If it succeeds, definitely a problem with JSON extractor. If it also returns an empty value, then something else is a problem.Kiril S.

1 Answers

0
votes

${expiredaccesstokenerror} in sampler is trying to get variable before request or response. In post processor you set the variable expiredaccesstokenerror but it's too late for displaying.