nmrao
9 years agoChampion Level 3
Property, which is passed using -P to testrunner, is not available in afterLoadScript
Noticing the following behaviour while testing the options of testrunner (both SoapUI NG / Open Source Edition).
Running a project using testrunner with -P<PropertyNamve>=<Value> option and reading this property in afterLoadScript of the project. It says property value is null which is not possibly expected (In My Opinion), could be a (latent) defect? Can it be confirmed if this understanding is correct? If it is a defect, then it can be addressed.
My understanding is that, the property passed to testrunner should be set during the loading of the project and the property made available in afterLoadScript
This is all the project is which contians just an assertion in afterLoadScript
<?xml version="1.0" encoding="UTF-8"?> <con:soapui-project activeEnvironment="Default" name="testParams" soapui-version="4.5.1" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:properties/><con:afterLoadScript>assert project.getPropertyValue('STABILITY_RBD_DATE'), "STABILITY_RBD_DATE Value is empty or null"</con:afterLoadScript><con:wssContainer/><con:sensitiveInformation/></con:soapui-project>
09:04:04,416 ERROR [SoapUITestCaseRunner] java.lang.AssertionError: STABILITY_RBD_DATE Value is empty or null. Expression: project.getPropertyValue(STABILITY_RBD_DATE) 09:04:04,416 ERROR [SoapUI] An error occured [STABILITY_RBD_DATE Value is empty or null. Expression: project.getPropertyValue(STABILITY_RBD_DATE)], see error log for detail java.lang.AssertionError: STABILITY_RBD_DATE Value is empty or null. Expression: project.getPropertyValue(STABILITY_RBD_DATE) at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:388) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:658) at Script1.run(Script1.groovy:1) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96) at com.eviware.soapui.impl.wsdl.WsdlProject.runAfterLoadScript(WsdlProject.java:1511) at com.eviware.soapui.impl.wsdl.WsdlProject.afterLoad(WsdlProject.java:565) at com.eviware.soapui.impl.wsdl.WsdlProject.loadProject(WsdlProject.java:407) at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:244) at com.eviware.soapui.impl.wsdl.WsdlProjectFactory.createNew(WsdlProjectFactory.java:41) at com.eviware.soapui.impl.wsdl.WsdlProjectFactory.createNew(WsdlProjectFactory.java:24) at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:337) at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:158) at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:89) at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:115)