【发布时间】:2018-10-13 20:28:42
【问题描述】:
我使用下面的代码从SoapUI 的请求中获取JSESSIONID 的值。
def setCookie = testRunner.testCase.testSteps["Request1"].testRequest.response.responseHeaders["Set-Cookie"]
re = /(JSESSIONID=[A-Za-z0-9]+)/
matcher = ( setCookie =~ re )
def jsesid = matcher[0][0]
log.info "$jsessid"
props = testRunner.testCase.getTestStepByName("Properties");
props.setPropertyValue('cookie',"$jsessid");
我将此变量放在其他请求的标头中,但得到一个新的 JSESSIONID 作为响应。所以我失去了会话,因为打开了一个新会话。
【问题讨论】:
标签: http soapui session-cookies jsessionid