Store return value of SOAP API into variable

Dear All,

Here is my Return Message in SOAP API:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:soap=“” xmlns:xsi=“” xmlns:xsd=“XML Schema”>



How can i store value of SessionID in Global Variable and use it for next API?


def content = response.getResponseBodyContent()
def textcontent = new XmlParser().parseText(result)
GlobalVariable.SessionID = (textcontent.StartSessionResult.SessionId.text())

By this code, i can assign value for variable now. But how can i import variable into request of next API?
here is the request:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi=“” xmlns:xsd=“” xmlns:soap=“”>



ConfigSetName is the value that i want to input variable

save the value to a global variable and grab it in the second testcase. this will be scoped only to a testsuite so you have to create one
or, at the end of tc1 return it as a value and call tc1 from tc2
or, export it to an external file, that will work across any scenario