DMc-Cabe
11 years agoOccasional Contributor
Variable endpoint support?
Hi There
I am trying to create a test suite which will allow passing of variable endpoint values from jenkins/maven
I have created a global property called ServiceEndpoint ${#Project#ServiceEndpoint} I am running into a number of issues when implementing this
1. I am unable to pass a value using the -Dmaven.soapui.test.serviceEndpoint=http://new.endpoint.com switch when running from the command line and or Jenkins. The value set in the xml file does not get overridden.
2. When creating Groovy assertions I am unable to pass the value of the variable endpoint to the holder.namespaces value
import com.eviware.soapui.support.XmlHolder
def serviceEndpoint = context.expand( '${#Project#ServiceEndpoint}' )
def holder = new XmlHolder( messageExchange.responseContentAsXml )
holder.namespaces["ns1"] = "$serviceEndpoint/aopui-service/v1/rest/request"
It returns the following "Error org.codehaus.groovy.runtime.GStringImpl cannot be cast to java.lang.String"
any suggestions on what I can do to over come these issues please?
I am trying to create a test suite which will allow passing of variable endpoint values from jenkins/maven
I have created a global property called ServiceEndpoint ${#Project#ServiceEndpoint} I am running into a number of issues when implementing this
1. I am unable to pass a value using the -Dmaven.soapui.test.serviceEndpoint=http://new.endpoint.com switch when running from the command line and or Jenkins. The value set in the xml file does not get overridden.
2. When creating Groovy assertions I am unable to pass the value of the variable endpoint to the holder.namespaces value
import com.eviware.soapui.support.XmlHolder
def serviceEndpoint = context.expand( '${#Project#ServiceEndpoint}' )
def holder = new XmlHolder( messageExchange.responseContentAsXml )
holder.namespaces["ns1"] = "$serviceEndpoint/aopui-service/v1/rest/request"
It returns the following "Error org.codehaus.groovy.runtime.GStringImpl cannot be cast to java.lang.String"
any suggestions on what I can do to over come these issues please?