PSTyler
8 years agoOccasional Contributor
Cannot get property 'testCase' on null object
I am trying to create methods in Utility.groovy class to use that method for all my getCodes.ashx page test Steps, where I can get a TestStep name dynamically during execution. But getting error java.lang.NullPointerException: Cannot get property ‘testCase’ on null object error at line:15 when calling method from GroovyScript step and getting Cannot get property ‘testCase’ on Null object when calling method within test step using ScriptAssertion.
For Groovy Script step I used
def xml = groovyUtils.getXmlHolder( testRunner.testCase.testSteps[TestStepName].testRequest.response.responseContent )
and for ScriptAssertion I used
def xml = groovyUtils.getXmlHolder( messageExchange.responseContent )