null pointer exception in soapui groovy script

1.4k Views Asked by At

I am receiving this null pointer exception and not sure how to resolve/debug it. The script contains a class with two methods. Code is doing what it is supposed to do. Any pointers on geeting started to resolve this?

 java.lang.NullPointerException
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:154)
    at com.eviware.soapui.model.testsuite.TestStep$run.call(Unknown Source)
    at Script48.run(Script48.groovy:22)
    at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
    at com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion.assertScript(GroovyScriptAssertion.java:116)
    at com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion.internalAssertResponse(GroovyScriptAssertion.java:128)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlMessageAssertion.assertResponse(WsdlMessageAssertion.java:150)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequest.assertResponse(WsdlTestRequest.java:176)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.propertyChange(WsdlTestRequestStep.java:339)
    at com.eviware.soapui.impl.wsdl.support.assertions.AssertionsSupport.propertyChange(AssertionsSupport.java:79)
    at java.beans.PropertyChangeSupport.fire(Unknown Source

Script looks like this.

import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner
    import com.eviware.soapui.support.types.StringToObjectMap
    import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext


    context.setProperty("searchChange", new searchChange())
    class searchChange{

        def search(a,b,TCRunner){

            def search_TestCase = TCRunner.testCase.testSuite.getTestCaseByName("TestCaseName")
              search_TestCase.setPropertyValue("a", a)
              search_TestCase.setPropertyValue("b", b)
              search_TestCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

            }


        def runner(tCase,mExchange){

                     new WsdlTestCaseRunner( tCase, new StringToObjectMap() );


            }


    }

When using the above class,the line(groovy:22) in code that throws exception is

scripts.testCases["Library"].testSteps["Lib"].run(context.getTestRunner(),context)
0

There are 0 best solutions below