cancel
Showing results for 
Search instead for 
Did you mean: 

[Resolved] Json Slurper + backslashes + Groovy support

Highlighted
Occasional Contributor

[Resolved] Json Slurper + backslashes + Groovy support

I am running into an issue with JSON slurper where its causing an exception in my script assertion.
My JSON response has back slashes in it and apparently is causing the issue.

There was a defect, apparently filed and fixed: http://jira.codehaus.org/browse/GROOVY- ... l-tabpanel
but that was approximately 2 years ago.

I understand JSON Slurper is not your product, but was curious if any of your engineers have heard of this problem with a Groovy script assertion.

Script Assertion code:
import groovy.json.JsonSlurper
def response = messageExchange.response.responseContent
def slurper = new JsonSlurper()
def json = slurper.parseText response

Output:
Expected a value on line: 1, column: 631.
But got an unterminated object.

I verified the response was valid JSON as well.

Thanks for any thoughts,

Craig
5 REPLIES 5
Highlighted
Community Expert

Re: Json Slurper + backslashes + Groovy support

Highlighted
Occasional Contributor

Re: Json Slurper + backslashes + Groovy support

Thank you
Highlighted
New Contributor

Re: Json Slurper + backslashes + Groovy support

wrong link, what the solution of that problem ?

Highlighted
New Contributor

Re: Json Slurper + backslashes + Groovy support

please, what the solution ?

Community Hero

Re: Json Slurper + backslashes + Groovy support

@razinkovaleksey: Please start a new thread and explain your problem. The thread you replied to is almost 4 years old. 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Filtering data retrieved from a DataSource

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors