prabhat
12 years agoNew Contributor
Unable to manipulate customproperty value using Maven(pom.x)
Hi,
I am using SOAP UI 5.0.0 to create the test cases for testing.
I am trying to automate the testCase using Maven (pom.xml)
In Our SOAP UI project we are setting custom properties to generate the dynamic json payload for the test steps defined in the testCase.
We are using using Groovy code to read the custom property values and manipulating the vale and again setting the value for the next iteration(running cycle).
Groovy code for manipulating custom property(givenName):
so that we can generate every time new payload for testcase (passing the property values in test step using "Getdata" feature). This functionality is working fine in SOAP UI 5.0.0 Browser.
But when i am creating the pom.xml file for this soap-ui project the custom property value is not manipulating for the next iteration.it is taking the old value.
Pom.xml :
Please suggest if i am missing something.
Please let me know if any more information required.
Thanks
Prabhat
I am using SOAP UI 5.0.0 to create the test cases for testing.
I am trying to automate the testCase using Maven (pom.xml)
In Our SOAP UI project we are setting custom properties to generate the dynamic json payload for the test steps defined in the testCase.
We are using using Groovy code to read the custom property values and manipulating the vale and again setting the value for the next iteration(running cycle).
Groovy code for manipulating custom property(givenName):
def givenName = testRunner.testCase.getPropertyValue("givenName");
def familyName = testRunner.testCase.getPropertyValue("familyName");
int counterValue = Integer.parseInt(givenName.replace("User0",""))
testRunner.testCase.setPropertyValue("givenName", "User0"+ String.valueOf(counterValue+1) );
so that we can generate every time new payload for testcase (passing the property values in test step using "Getdata" feature). This functionality is working fine in SOAP UI 5.0.0 Browser.
But when i am creating the pom.xml file for this soap-ui project the custom property value is not manipulating for the next iteration.it is taking the old value.
Pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>5.0.0</modelVersion>
<groupId>com.smartbear.samples</groupId>
<artifactId>soapui-maven2-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>D:/Project/src/test/soapui/UserManagement-Updated-soapui-project.xml</projectFile>
<outputFolder>D:/Project/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<printReport>false</printReport>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Please suggest if i am missing something.
Please let me know if any more information required.
Thanks
Prabhat