Bug 65318 - Incorrect display of decimal numbers in JSON related elements
Summary: Incorrect display of decimal numbers in JSON related elements
Status: NEW
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: Nightly (Please specify date)
Hardware: PC All
: P2 normal (vote)
Target Milestone: JMETER_5.5
Assignee: JMeter issues mailing list
Depends on:
Reported: 2021-05-19 21:11 UTC by eR@SeR
Modified: 2022-08-09 05:10 UTC (History)
0 users

wrongDisplayOfDecmalNumber (8.41 KB, application/xml)
2021-05-19 21:11 UTC, eR@SeR
Example testplan for JSON Assertion bug (5.06 KB, application/xml)
2022-08-09 05:10 UTC, andreaslind01

Note You need to log in before you can comment on or make changes to this bug.
Description eR@SeR 2021-05-19 21:11:47 UTC
Created attachment 37869 [details]


In the attached test plan, there are JSON Extractor, JSON JMESPath Extractor, JSON Assertion, JSON JMESPath Assertion, and Response Assertion elements. There are several issues found when the test is executed:

1. Provided decimal number is shown as the scientific notation "2.1474836475E9" in VRT (JSON, JSON Path Tester, and JSON JMESPath Tester), but it should be "2147483647.5000". Same number is shown if "$.number" or "number" JSON paths are used in corresponding JSON Testers.
2. JSON Assertion shows the message "Value expected to be '2147483647.5000', but found '2147483647,5'". Expected result should be "2147483647.5000", and assertion should pass.
3. JSON JMESPath Assertion shows the message "Value expected to be equal to 2147483647.5000". From this message it cannot be known what value is evaluated from the provided path. The expected message could be "Value expected to be '2147483647.5000', but found '2147483647,5'", same as in JSON Assertion (if the assertion fails of course). The expected result should be "2147483647.5000", and the assertion should pass.
4. JSON Extractor and JSON JMESPath Extractor extract values as the scientific notation "2.1474836475E9" so when variables are checked in Response Assertion they fail. Please check Debug Sampler in VRT. The expected result should be "2147483647.5000".

IMO, all JSON-related elements should evaluate literal decimal numbers since they cannot be properly asserted without using a code (String.format() function for example).

P.S. I use non-English localization settings where the decimal number symbol is a comma.

Jmeter 5.5 e0e9787
Microsoft Windows 10 Enterprise 64-bit
java version "15.0.1" 2020-10-20
Comment 1 Felix Schumacher 2021-05-30 10:27:14 UTC
I think this bug would be (at least partly) solved by using the patch from bug 65299.

The remaining broken assertions would be the plain text assertions, but they are plain wrong :)

@Nikola, are you able to patch the source yourself and give it a try?
Comment 2 eR@SeR 2021-05-30 11:45:35 UTC
Hi Felix,

Could you send me a compiled version to check it, please?
Comment 3 andreaslind01 2022-08-09 05:09:30 UTC

I created a PR that should fix the issues with the JSON Assertion:
Comment 4 andreaslind01 2022-08-09 05:10:55 UTC
Created attachment 38361 [details]
Example testplan for JSON Assertion bug
Comment 5 The ASF infrastructure team 2022-09-24 20:38:22 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5539