2

Apologies if this is something fundamental which I should already know. I've got a test set up in jmeter using a Json Extractor. The data which it is extracting is in the format:

"data item 1", "data item 2", "data item 3"

The problem I have is that the extractor is pulling the data out and removing the spaces.

Is this normal? Or is there a setting I need to tweak to stop it doing this?

The service under test is using a Swagger page as a front end and the output from the service is in the format I describe above.

I can alter my expected results to remove all the spaces, but this may cause issues further down the line.

Any help much appreciated. Thanks.

  • What's the actual payload look like vs. the JSON path you're using? – ernie Feb 22 '17 at 5:12
  • Can't actually show you the payload as it's on a different system which I can't transfer stuff out of. As it is, having done some playing about, I think this is Swagger being 'helpful' and formatting stuff to make it more readable. – Tufty Feb 22 '17 at 14:09
  • I'm really confused . . . you're running Jmeter directly against the API and trying to generate known good data using swagger which you're then codifying into Jmeter? – ernie Feb 22 '17 at 20:08
  • Not quite ernie. I'm producing the Jmeter tests based on a set of manual tests which were executed in Swagger. We know the system is good and acting correctly, we just need the jmeter tests to work. Happily now, they do! :) – Tufty Feb 24 '17 at 10:00
  • The answer on SO says no spaces were removed. It's unclear to me what your actual fix was? – ernie Feb 24 '17 at 23:01
1

I asked the same question in the main Stack Overflow space and got a good answer back from someone there:

jmeter-json-extractor-removing-white-space-causes-test-to-fail - Answered

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.