cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to capture the DB response in variable

Highlighted
Occasional Contributor

Not able to capture the DB response in variable

Have created the array and XmlSlurper for capturing db response

 

def dbvalues=[]
dbsluper.ResultSet.Row.each{
 dbvalues.add(it.value)
}

 

log.info("Db results"+dbvalues)

 

output:It is giving empty results

 

I need to compare my json response with db response

 

My json structure has nearly 200 elements which are non repitive

 

can you please suggest what is the best way to achieve this

 

Thanks!!

1 REPLY 1
Highlighted

Thank you for posting to our Community Forum.

 

The script snippet provided isn't enough information to assess where the issue is occurring. Please provide the full script where you are using XMLSlurper to parse the DB.

 

To compare that information to a JSON response, you need to parse the response with JSON Slurper and run the comparison.

 

http://docs.groovy-lang.org/2.4.9/html/gapi/groovy/json/JsonSlurper.html

 

Have a great day!

Best,
Steven
Atlassian Ecosystem Manager
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors