Contributions
- 11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes1Comment
[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, Craig11 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.7KViews0likes5CommentsRe: Using Groovy to grab the cookie in the request header
Henrik, Thank you! That did it! I can see the value logged now. I am getting an error when transferring, but hopefully that is minor. def request = testRunner.testCase.testSteps["CustomersForm"].testRequest def headers = request.requestHeaders def myCookie = headers['Cookie'] log.info ("This is the value:" + myCookie) testRunner.testCase.testSuite.project.setPropertyValue("Cookie", myCookie) Error: groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlProjectPro.setPropertyValue() is applicable for argument types: (java.lang.String, java.util.ArrayList) values: [Cookie, [ASP.NET_SessionId=lzbgzu450pm12u2mpt0w0oiq; admin-eaq-admin702=44A7E68438AB79C7D0886BBDBE92252BB39F066CF0A4358911D1C1AFFAA51BC6DF4E7C4247ECB58002886A43EE60FBDE03C4E441B4883DBC6C3D22367C89DDA475390924AB62FAE0E5CFC446051F18D6CD06EBAEC81024402E3220FC3B633335E80B2219F15A7F9A9E976B63807948F98B0CBD758AD8AC3D6EF3A174AE8AFD442BC8536239B8D28238E39BD44EBCCA355580A1C1]] Possible solutions: setPropertyValue(java.lang.String, java.lang.String), setPropertyValue(java.lang.String, java.lang.String), getPropertyValue(java.lang.String), getPropertyValue(java.lang.String) error at line: 7 I will investigate this, but if you no what it is off the top of your head, let me know. You guys are great! Thanks!11 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.4KViews0likes0CommentsRe: Using Groovy to grab the cookie in the request header
Thanks Henrik. Partially but as the web recording didn't log one of the responses because of a redirect (it appears), I am looking to get the cookie from the request header. I attached a screen shot. I need to grab the value for the cookie. Thanks, Craig11 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.5KViews0likes0CommentsUsing Groovy to grab the cookie in the request header
I used the web recording tool to authenticate via http into a server. However, there is some kind of redirect done and I don't see the step where the response comes back from the server with the cookie value in it. The next teststep contains the value I need, but I am trying to locate the groovy script classes that will help access the Cookie parameter value in the http header. Any thoughts? Craig11 years agoPlace ReadyAPI QuestionsReadyAPI Questions6.9KViews0likes5Comments