12 years ago
property expansion not always working from ant build
I have been using mostly TestSuite level properties and they always work fine but TestCase level and properties inside of a "Properties" test step are not always working. For example I have below part of the xml used in a REST call:
<XXX>${#TestSuite#filename}</XXX>
<YYY>${#TestCase#filenamey}</YYY>
<ZZZ>${#TestCase#filenamez}</ZZZ>
<AAA>${MyProps#filenamez}</AAA>
When I test inside of soapui and look at the RAW view most of the values look good BUT when I run from an ant build script only the TestSuite property has a value - the rest remain empty. Here is my ant build script:
<target name="SignTest" depends="compile">
<java classname="com.eviware.soapui.tools.SoapUITestCaseRunner" fork="true" maxmemory="1024m">
<arg value="-sTestSuite1"/>
<arg value="-Dsoapui.properties=${basedir}/envs/common.properties"/>
<arg value="-Dsoapui.properties.TestSuite1=${basedir}/envs/${env.JENKINS_TARGET_ENV}.properties"/>
<arg value="-t"/>
<arg file="${basedir}/envs/soapui-settings-${env.JENKINS_TARGET_ENV}.xml"/>
<arg value="-Dgroovy.source.encoding=iso-8859-1"/>
<arg value="-j"/>
<arg value="-f"/>
<arg file="${reports.dir}"/>
<arg file="${basedir}/soapui-projects/SignTest-soapui-project.xml"/>
<classpath>
<fileset dir="lib" >
<include name="**/*" />
</fileset>
</classpath>
</java>
</target>
The request during the test run:
[java] <XXX>C:\\Projects\\test.txt</XXX>
[java] <YYY></YYY>
[java] <ZZZ></ZZZ>
[java] <AAA></AAA>
[java] <BBB></BBB>
Only the TestSuite level property has a value. I've tried a few different variations but I cannot get this to work when running outside of soapui. Is there any trick to get this to work?
BTW, I'm running on win7 soapui 4.5.1.
thanks,
Paul.
<XXX>${#TestSuite#filename}</XXX>
<YYY>${#TestCase#filenamey}</YYY>
<ZZZ>${#TestCase#filenamez}</ZZZ>
<AAA>${MyProps#filenamez}</AAA>
When I test inside of soapui and look at the RAW view most of the values look good BUT when I run from an ant build script only the TestSuite property has a value - the rest remain empty. Here is my ant build script:
<target name="SignTest" depends="compile">
<java classname="com.eviware.soapui.tools.SoapUITestCaseRunner" fork="true" maxmemory="1024m">
<arg value="-sTestSuite1"/>
<arg value="-Dsoapui.properties=${basedir}/envs/common.properties"/>
<arg value="-Dsoapui.properties.TestSuite1=${basedir}/envs/${env.JENKINS_TARGET_ENV}.properties"/>
<arg value="-t"/>
<arg file="${basedir}/envs/soapui-settings-${env.JENKINS_TARGET_ENV}.xml"/>
<arg value="-Dgroovy.source.encoding=iso-8859-1"/>
<arg value="-j"/>
<arg value="-f"/>
<arg file="${reports.dir}"/>
<arg file="${basedir}/soapui-projects/SignTest-soapui-project.xml"/>
<classpath>
<fileset dir="lib" >
<include name="**/*" />
</fileset>
</classpath>
</java>
</target>
The request during the test run:
[java] <XXX>C:\\Projects\\test.txt</XXX>
[java] <YYY></YYY>
[java] <ZZZ></ZZZ>
[java] <AAA></AAA>
[java] <BBB></BBB>
Only the TestSuite level property has a value. I've tried a few different variations but I cannot get this to work when running outside of soapui. Is there any trick to get this to work?
BTW, I'm running on win7 soapui 4.5.1.
thanks,
Paul.