Forum Discussion

jayaraj's avatar
jayaraj
Regular Visitor
7 years ago

unable to pass value dynamically

unable to pass the value dyanmically 

 

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def testCase = testRunner.testCase.testSuite.project.getTestSuiteByName("UC_TEST_SUITE").getTestCaseByName("RepaymentScheduleSoapBinding TestCase");
def StepList = testCase.getTestStepList()
StepList.each{
String teststepname1 = "$it.name"
log.info("teststepname: "+teststepname1)
tStep = testCase.getTestStepByName('${teststepname1}')
def runner1 = tStep.run(testRunner, context)
}

 

  • Tue Jul 17 14:35:59 EDT 2018: ERROR: An error occurred in the script of the Groovy Script test step [Execute_all_case]:
  • Tue Jul 17 14:35:59 EDT 2018: ERROR: java.lang.NullPointerException: Cannot invoke method run() on null object
  • java.lang.NullPointerException: Cannot invoke method run() on null object
  • at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
  • at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
  • at Script58$_run_closure1.doCall(Script58.groovy:14)
  • at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  • at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  • at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  • at java.lang.reflect.Method.invoke(Method.java:498)
  • at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
  • at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  • at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
  • at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
  • at groovy.lang.Closure.call(Closure.java:426)
  • at groovy.lang.Closure.call(Closure.java:442)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
  • at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
  • at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
  • at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
  • at Script58.run(Script58.groovy:10)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
  • at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:329)
  • at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  • at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  • at java.lang.Thread.run(Thread.java:748)
  • Tue Jul 17 14:36:27 EDT 2018: ERROR: An error occurred in the script of the Groovy Script test step [Execute_all_case]:
  • Tue Jul 17 14:36:27 EDT 2018: ERROR: java.lang.NullPointerException: Cannot invoke method run() on null object
  • java.lang.NullPointerException: Cannot invoke method run() on null object
  • at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
  • at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
  • at Script59$_run_closure1.doCall(Script59.groovy:14)
  • at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  • at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  • at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  • at java.lang.reflect.Method.invoke(Method.java:498)
  • at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
  • at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  • at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
  • at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
  • at groovy.lang.Closure.call(Closure.java:426)
  • at groovy.lang.Closure.call(Closure.java:442)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
  • at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
  • at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
  • at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
  • at Script59.run(Script59.groovy:10)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
  • at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:329)
  • at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  • at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  • at java.lang.Thread.run(Thread.java:748)
  • Tue Jul 17 14:37:21 EDT 2018: ERROR: An error occurred in the script of the Groovy Script test step [Execute_all_case]:
  • Tue Jul 17 14:37:21 EDT 2018: ERROR: java.lang.NullPointerException: Cannot invoke method run() on null object
  • java.lang.NullPointerException: Cannot invoke method run() on null object
  • at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
  • at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
  • at Script60$_run_closure1.doCall(Script60.groovy:16)
  • at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  • at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  • at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  • at java.lang.reflect.Method.invoke(Method.java:498)
  • at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
  • at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  • at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
  • at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
  • at groovy.lang.Closure.call(Closure.java:426)
  • at groovy.lang.Closure.call(Closure.java:442)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
  • at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
  • at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
  • at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
  • at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
  • at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
  • at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
  • at Script60.run(Script60.groovy:12)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
  • at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
  • at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156)
  • at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:329)
  • at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  • at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  • at java.lang.Thread.run(Thread.java:748)
  • def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
    def testCase = testRunner.testCase.testSuite.project.getTestSuiteByName("UC_TEST_SUITE").getTestCaseByName("RepaymentScheduleSoapBinding TestCase");
    def StepList = testCase.getTestStepList()
    StepList.each{
    String teststepname1 = it.name
    log.info("teststepname: "+teststepname1)
    tStep = testCase.getTestStepByName(teststepname1)
    def runner1 = tStep.run(testRunner, context)
    }

    try with changes will work !!