Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Http 用于管理cookies的SoapUI_Http_Soapui_Session Cookies_Jsessionid - Fatal编程技术网

Http 用于管理cookies的SoapUI

Http 用于管理cookies的SoapUI,http,soapui,session-cookies,jsessionid,Http,Soapui,Session Cookies,Jsessionid,我使用下面的代码从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 "$jsess

我使用下面的代码从
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。因此,我丢失了会话,因为打开了一个新会话。

您可能已经在上遇到了类似问题的描述

除此之外,您还需要在测试用例的选项中设置