Forum Discussion

Phreak's avatar
New Contributor
8 years ago

Remove character from test case response when used in next test case step

Hi All,


I'm really new to SoapUI and I'm trying to do something extremely simple that I've done in bash many many times, so please excuse my ignorance as I'm sure this problem is easier to solve than I'm making it.


I've started a test case, in step one I make an authentication call and get back a token. However the response has some content at the beginning of the string "" that I'd like to remove and use the rest of the string in the next step of the test case that validates that token.


In the second step of the test case, I'm able to use ${Authenticate#Response} and get the full response, but how would I modify that response before I send it to the web service?? I've been looking at Groovy Scripts a bit, and I think that's likely the answer, but I can't seem to get anything in there to work at all. I'm not familiar with java programming so that's not helping. This is what I tried, and frankly, I'm sure it's way off track...


def project = testRunner.testCase.testSuite.project;

def tcase = project.testSuites["SSO"].testCases["SSO"];

def tstep = tcase.getTestStepByName("Authenticate");

def response_SSO = tstep.getProperty("response");

response_SSO = content.replaceAll("","")


How far off am I here? I'm a bit frustrated right now as this seems like a lot of effort to do something simple.


Any assistance would be greatly appreciated.



3 Replies