mtkhan1980
3 years agoNew Contributor
TestSuiteRunListener.afterTestCase
I have a property at the testSuite level (different test suite from the one which is being run in the same project) which I want to use in the TestSuiteRunListener.afterTestCase event. What I am trying to achieve is to insert data in the table, which I am storing the properties.
Tried this method but I getting an error
def subscriberId = testRunner.testCase.testSuite.project.getTestSuiteByName('getSetAndValidateData').getPropertyValue( "subscriberid" )
log.info("SubscriberId is : "+subscriberId)
Error:
- Wed Oct 20 00:59:11 MDT 2021: ERROR: com.eviware.soapui.support.scripting.ScriptException: Error in TestSuiteRunListener.afterRun
- com.eviware.soapui.support.scripting.ScriptException: Error in TestSuiteRunListener.afterRun
- at com.eviware.soapui.eventhandlers.support.DefaultSoapUIEventHandler.invoke(DefaultSoapUIEventHandler.java:31)
- at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(AbstractEventHandlerMetaData.java:80)
- at com.eviware.soapui.eventhandlers.support.AbstractEventHandlerMetaData.invokeHandlers(AbstractEventHandlerMetaData.java:61)
- at com.eviware.soapui.eventhandlers.impl.EventHandlersTestSuiteRunListener.afterRun(EventHandlersTestSuiteRunListener.java:38)
- at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner$1.notifyListener(WsdlTestSuiteRunner.java:242)
- at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.notifyListeners(WsdlTestSuiteRunner.java:298)
- at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.notifyAfterRun(WsdlTestSuiteRunner.java:239)
- at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.internalFinally(WsdlTestSuiteRunner.java:228)
- at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.internalFinally(WsdlTestSuiteRunner.java:1)
- at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:154)
- at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
- at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
- at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
- at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
- at java.base/java.lang.Thread.run(Thread.java:831)
- Caused by: groovy.lang.MissingPropertyException: No such property: testCase for class: com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner
- at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)
- at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:65)
- at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:329)
- at Script1.run(Script1.groovy:6)
- at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:94)
- at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:83)
- at com.eviware.soapui.eventhandlers.support.DefaultSoapUIScript.invoke(DefaultSoapUIScript.java:42)
- at com.eviware.soapui.eventhandlers.support.DefaultSoapUIEventHandler.invoke(DefaultSoapUIEventHandler.java:29)