Execute existing testcase in Setup Script and get value from that response
Hi,
is there any way to execute existing testcase in Setup Script and get value from that response.
My scenario
Execute Login Test case as part of Setup Script of Test Suite. And from the response take value of token and store it Global properties. so that i can use that token in all the test cases. I tried the below but I am unable to retrieve the values from the response.
def tc =testSuite.getTestCaseByName( "VerifyPOSTAuthApi_Returns200OK" )
def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
tc.run(properties, false)
def response = context.expand( '$VerifyPOSTAuthApi_Returns200OK#Response}' ).toString()
def json = new JsonSlurper().parseText (response)
It is throwing an error at last line.
Thanks a lot.
Regards,
Shashavali