Forum Discussion
2 Replies
- Hi!
I think the reason for this is that you are assuming that
""+teststep+"#Response"
will always resolve to an actual response; if the teststep has not been run or if the testStep is of a type that doesn't have a response you will get this error
maybe you could modify your script to contain:
...
for (int i in 1..<StepCnt)
{
def step = context.testCase.getTestStepAt(i)
if( step instanceof com.eviware.soapui.model.testsuite.SamplerTestStep && step.testRequest.response != null )
{
holder = groovyUtils.getXmlHolder( step.name+"#Response")
}
}
...
Does that help?
regards,
/Ole
eviware.com - RohitBBorseContributorHi,
Sorry for late reply. I was away from office for the days.
This have helped me and i have successfully stepped up to the next level.
Thanks a lot
Here is a code snippet
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
for (int i in 0..<context.testCase.testStepCount)
{
step=context.testCase.getTestStepAt(i)
if( step instanceof com.eviware.soapui.model.testsuite.SamplerTestStep && step.testRequest.response != null )
{
Response = groovyUtils.getXmlHolder(step.name+"#Response")
Severity = Response.getNodeValue("//*:Severity")
log.info (Severity)
}
}
Thanks
Rohit Borse