cancel
Showing results for 
Search instead for 
Did you mean: 

Quotes added in expected result for json

SOLVED
Occasional Contributor

Quotes added in expected result for json

When taking the actual value to the Expected Result of a JSONPath Match assertion, SoapUI adds double quotes.

 

For example if response is:

{ "name": "John Doe" }

 

Then when the JSONPatch expression = $.name, clicking Select From Current will add "John Doe" (including the double quotes) to the expected Result box. Next clicking Test wil show the assertion failed. Thus I need to manually remove the quotes to make the assertion correct.

 

Same thing happens when creating the assertion from the response window using Add assertion>for content.

 

Am I doing anything wrong? Is there a setting to change this?

 

N.B. The open source version of SoapUI does this better as it fills the expected result without the quotes. Pro (I'm using SoapUI Pro 2.8.0) should be better than the freeware version, shouldn't it?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: Quotes added in expected result for json

Hi @fsamwel,

 

I see that you worked with our Support Team. As far as I understand you couldn't reproduce the issue anymore. 

 

Let's mark this question as solved. Please post the update if you see the issue again.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

6 REPLIES 6
Community Hero

Re: Quotes added in expected result for json

Hi @fsamwel 

 

SoapUI Pro v2.8 is really, really, really old

 

Yes you'd expect the Pro version to be more effective than the open source version - but what version of the open source are you actually comparing your Pro instance against?

 

I think the latest open source version is about v5.5.0 - so if you're comparing a Pro version of software from I don't know - maybe 10 years ago against a reasonably new version of the open source - then surely you'd expect the open source version to be better!

 

Cheers,

 

rich

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Occasional Contributor

Re: Quotes added in expected result for json

> SoapUI Pro v2.8 is really, really, really old

Hi Rich, thanks for your response. I downloaded the update just Today, so think it's not that old. I'm actually using SoapUI Pro in ReadyAPI 2.8.0. Sorry for the confusion.

Community Hero

Re: Quotes added in expected result for json

Hi @fsamwel

 

ok - Im running v2.7.0 (I always wait for a while before upgrading to the latest version) and I've just tried reproducing what I think you've described - but I'm not seeing quote marks being inserted - please see screenshot of a JSONContent Match assertion

Capture.PNG

 

 

The value was generated without quote marks when I hit 'assert' >> 'for content'

 

I then selected 'from the current' button - but stiill no quote marks.

 

can you provide a screenshot to explain?

 

cheers

 

rich

 

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Occasional Contributor

Re: Quotes added in expected result for json

I've added two screenshots.

In my json response (Outline) I rightclick the mouse on an attribute and select Add Assertion > for Content.

Next the assertion is shown with quotes added to the attribute content.

 

When clicking Select From Current also the attribute content is added surrounded with double quotes.

 

I also noticed that when the attribute is not a string, but for example a boolean, the quotes are not added.

 

regards, Frank

Community Hero

Re: Quotes added in expected result for json

Hi @fsamwel 

 

ok - well that looks like a v2.8 change where the implications to the change/improvement hasn't been completely thought out.

 

I can understand why SmartBear would make this change in some ways - it means the user has an idea of the datatype being used - json has 4 primitive datatypes:

 

1. text/string,

2. numeric,

3. boolean (true/false)

4. null

 

Only string/text values are wrapped with quote marks (e.g. "text value" - this includes dates, datetimes btw - as dates/datetimes are not considered numeric) - all the other datatypes don't get wrapped with quote marks.

 

As I say - it looks like SmartBear may have introduced this change so the user knows what 'type' the data is - but this then causes your assertion to fail because the 'value' doesn't include quote marks.

 

This needs a tech support call (see link) cos I'd say this change has introduced a defect that's gonna get old pretty quick unless the other functionality is updated to support the change (like when you hit the 'Test' button)

 

Best answer I've got for now unless SmartBear can sort this out?  I'd download v2.7 - it doesn't display this behaviour.

 

Cheers,

 

rich

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Community Manager

Re: Quotes added in expected result for json

Hi @fsamwel,

 

I see that you worked with our Support Team. As far as I understand you couldn't reproduce the issue anymore. 

 

Let's mark this question as solved. Please post the update if you see the issue again.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors