SOAP UI Groovy脚本返回异常:StringIndexOutOfBoundsException(-2)我不明白为什么

时间:2014-05-21 09:53:12

标签: php soap groovy

我目前正在使用SoapUI,我有点像菜鸟我正在尝试使用脚本从HTTP标头中检索Set-Cookie PHP会话ID但是我得到了上面的例外。无论这里是我的脚本代码:

def header = testRunner.testCase.getTestStepByName("Authenticate").httpRequest.response.responseHeaders["Set-Cookie"]
header = header.toString()
start = header.indexOf("PHPSESSID=")
end = header.indexOf("; Path=")
sessionIdValue= header.substring(start, end)
testRunner.testCase.getTestStepByName("FavouriteLocations").setPropertyValue("session_key",sessionIdValue)

我很感激您的任何意见。

0 个答案:

没有答案
相关问题