cancel
Showing results for 
Search instead for 
Did you mean: 

ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

SOLVED
Occasional Contributor

ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

After upgrade to 2.5 all my assertions that had values with single quotes are always failing. 

 

I tried the following with no luck:

 - recreating the assertion

 - get value from the test (was thinking maybe there are some invisible characters or spaces)

 

Assertion is failing with the message:

-> Comparison failed. Path: [my path (JSON)]; Expected value: [my 'value' not found]; Actual value: [my 'value' not found].

 

P.S. Using wildcard to remove single quotes is the only thing that works as a workaround.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Occasional Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

I opened a support ticket with Smartbear and they were able to reproduce the issue. It was forwarded to R&D team.

 

View solution in original post

Occasional Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

update from our developers:

"It seems that in ReadyAPI 2.5.0, the Expected Result is now parsed as a JSON object, so in order to use special characters such as quotes, they will need to be escaped if they are part of a string value. 

That said, please change your Expected Result to the following and let me know if that works for you:  \'yourValue\'."

 

 

View solution in original post

9 REPLIES 9
Super Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

If there is nothing in the release notes to state that something has changed I think it is safe to assume it should work as before, therefore I would raise a issue with SmartBear support:

 

https://support.smartbear.com/message/?prod=ReadyAPI

 

If there is a bug you can ask them to release a fix in the maintenance builds. When I have upgraded in the past I have had to get various bugs fixed and release in a maintenance build.

 

If you have found a bug (and get a fix) please reply back here and let us know.

 

 

Flo
Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

Hello. Four your information I had the exact same issue. I roolback in 2.4.0. I will wait for maintenance build, I hope

Occasional Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

I opened a support ticket with Smartbear and they were able to reproduce the issue. It was forwarded to R&D team.

 

View solution in original post

Occasional Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

update from our developers:

"It seems that in ReadyAPI 2.5.0, the Expected Result is now parsed as a JSON object, so in order to use special characters such as quotes, they will need to be escaped if they are part of a string value. 

That said, please change your Expected Result to the following and let me know if that works for you:  \'yourValue\'."

 

 

View solution in original post

Flo
Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

So they are asking to change assertion because of a minor update of ReadyAPI ... Hum I am surprised.

Do you have the link to your support request please ?

Flo.

Occasional Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

Sorry, I am not sure how to send a link for my case. But my Case #00314272.

 

The last communication was that while they recommend updating your assertions, they recognize that "Select from Current" is not escaping quotes, so it generates incorrect assertion.  And they are looking into it.

 

I am surprised as well at the suggested resolution - update assertions to have it working in the newer version of ReadyAPI. Sounds more like a bug than a feature to me personally.  I have rolled back to 2.3 for now.

 

Community Hero

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

Hi,

 

I've been reading about json reserved characters today (due to a different post) - a single quote is not one of the json reserved chars and hence should NOT need escaping!?????

 

see the link from stackoverflow

 

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 title of the post to something more descriptive? This will help people when searching for problems.
Occasional Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

I am having the same issue when using backslashes (asserting paths that are stored as properties). This is causing a headache.

Flo
Contributor

Re: ReadyAPI 2.5 - Content assertions with values that contain single quotes are always failing

Does the version 2.6.0 solved this issue ? It is not solved on my case, so I would like others feedbacks

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