T
T
Tatyana2015-07-15 23:29:19
SOAP
Tatyana, 2015-07-15 23:29:19

How to pull cookies from a request in groovy?

I use the script
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def httpRequestHeaders = testRunner.testCase.testSteps["Dashboard"].testRequest.requestHeaders
def cookie2 = httpRequestHeaders["Cookie3"]
cookie2 = cookie2.toString( )
log.info(cookie2)
groovyUtils.setPropertyValue("Properties", "cookie2", cookie2)
But I specified "Cookie3" in the Dashboard test step myself as a header, but I need to get the cookies that soapui itself carries within the session, that is, Cookie and Cookie2, this is how the raw request looks like, from which I need to get the files
GET www/admin/dashboard HTTP/1.1
Accept-Encoding: gzip,deflate
Cookie3: test
Host: develop.cutwise.dev.cutwise.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.3.1 (java 1.5)
Cookie: PHPSESSID=c14unieegfh9p4dd8eki03tt03
Cookie2: $Version=1
By the way, there is no cookie in response to this request no, there is no Set-Cookie header. I don't know what to do, I hope there is a solution.
I would also like to understand how soapui simulates a session and how it adds autocookies.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question