Forum Discussion
Lucian
8 years agoCommunity Hero
You can use a groovy script to extract the id. If the message "Attribute Party Id.." is always the same this should work:
// Get the raw response from a certain test step
def rawResponse = testRunner.testCase.testSteps["NameOfYourRequestTestStep"].testRequest.response.contentAsString
// Find the index where the product id begins
def startIndexOfId = rawResponse.indexOf("Attribute 'Party ID' is transformed from ('') to ('") + "Attribute 'Party ID' is transformed from ('') to ('".length()
// Cut the string from the beggining of the id to the end of the rawResponse
def id = rawResponse.substring( startIndexOfId )
// Find the place where the id is ending
def endIndexOfId = id.indexOf("')")
// Extract the id
id = id.substring( 0, endIndexOfId )
Cheers!