ContributionsMost RecentMost LikesSolutionsRe: The response from JSON tab does not match to the one from RAW when there are zeros in decimal Hi! Thank you for the responses! Unfortunately I cannot try the new version as the project is at a critical point this period. But I hope that I can download the new version and try it maybe in a month. Thanks again for all help!!! :) Re: The response from JSON tab does not match to the one from RAW when there are zeros in decimal Hi Tanya, While searching for a solution I came up with this post from 2015 https://community.smartbear.com/t5/SoapUI-Pro/JSON-Response-tab-displaying-decimal-values-incorrectly-compared/td-p/109195 It's the same problem as I have and according to the post above this should have been fixed in version 1.5. Has anyone else come up with the same problem for ReadyAPI version 2.1.0 and REST services? Any help is welcomed. Re: The response from JSON tab does not match to the one from RAW when there are zeros in decimal Hi, The float is not solving the problem. For example the "amount": 20000.00 (RAW) is now shown as 20000.0 in json and when I have the log.info for this node. So the assertion is still failing even if I declare it as float or double. The response from JSON tab does not match to the one from RAW when there are zeros in decimal Hi, I am using ReadyAPI 2.1.0. I have the following response in RAW: { "amounts": { "amount": 20000.00, "amount2": 500.50, "amount3": 100.55 } } But the response in JSON looks like this: { "amounts": { "amount": 20000.0, "amount2": 500.5, "amount3": 100.55 } } It seems that the JSON is deleting the last zeros from the decimal part. I am trying to write a script that will validate that the amounts are up to 8 and must have 2 decimals. This is my script: import groovy.json.JsonSlurper def response=messageExchange.response.responseContent def json=new JsonSlurper().parseText(response) def amount=json.amounts.amount assert amount==~ /\d{0,8}\.\d{2}/ But this fails for amount and amount2 as the zero is not in the json response and when I use log.info for amount I get 20000, for amount2: 500.5 and for amount3: 100.55. Does someone know how to fix this? Re: Assertion returns null when json node has value Hi! Thank you for answering so fast! But what I posted was not the real response but only a mock so that I could explain what the problem was (As I cannot publish online the real response) so that didn't work for me. Today I tried something else and it worked. Here is I used in my script: import groovy.json.JsonSlurper def response=messageExchange.response.responseContent def json=new JsonSlurper().parseText(response) if (json.registers.name){ def first=context.expand('${testStepName#Response#$[\'registers\'][\'name\'][\'first\']}') assert first!=null } I can't figure out why the first script didn't work and returned null but this solution is working for me and I get the right value from the response. Assertion returns null when json node has value Hi everyone! I am trying to get and assert the vale of the node first from the following json response but the assertion returns null even when the value is returned : {"registers":{ "id": "123", "date": "2018-08-01", "name": { "first": "George", "last": "Smith" } } } This is my script assertion: import groovy.json.JsonSlurper def response=messageExchange.response.responseContent def json=new JsonSlurper().parseText(response) if (json.registers.name){ def first=json.registers.name.first assert first!=null } The assertion fails as the json.registers.name.first returns null. But this shouldn't happen as there is a value for first in the response. When I try log.info json.registers.name I get {first=George, last=Smith}. So why do I get null when I try to get the value of the first? All help and ideas are appreciated. Solved