0

I have a problem soupui test cases runnnig with maven. Normally we created test data in the program with groovy script. Now, i want to run with external properties file. I have a file named properties.txt . When i running with command line i use this command "mvn clean test" . With my pom.xml i could not use my property values inside the project xml. Seems like i could not reach these values.

Here is my pom.xml:

`<configuration> 
<projectFile>${basedir}/src/test/soapRegression_development.xml</projectFile> 
<outputFolder>${basedir}/target/</outputFolder> 
<junitReport>true</junitReport> 
<printReport>false</printReport> 
<soapuiProperties> 
<property> 
<name>soapui.logroot</name> 
<value>${project.build.directory}/soapui-logs/</value> 
</property> 
<property> 
<name>soapui.properties.soapRegression_development</name> 
<value>${basedir}/properties.txt</value> 
</property> 
</soapuiProperties> 
<!--projectProperties> <value>envName=${urlName}</value> </projectProperties --> 
<endpoint>${endpoint}</endpoint> 
</configuration>`

2 Answers2

0

Looking at the Maven 2.x documentation page at soapui.org :

https://www.soapui.org/test-automation/maven/maven-2-x.html

...I can't see a way to set a parameter to specify a property file.

However. I think you should be able to provide one Project property, giving the path to your properties.txt, and then configure the setup script of your SoapUI project, to read that properties.txt, and transfer the name/value to whereever you want to store them. Global propery. Project property. etc... Thus the parameters should be in place by the time you execute your first testcase.

Steen
  • 853
  • 5
  • 12
0

Why do you need to pass path of property file ? It should be relative to your project. Can't we read current directory from groovy and then point to properties file using relative path . In my opinion this is right way to do it

Nilesh G
  • 103
  • 1
  • 9