I have a problem; this is the groovy script:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
xmlResponseHolder = groovyUtils.getXmlHolder("LIR APT NAKED#ResponseAsXML")
xmlBody = new XmlSlurper().parseText(xmlResponseHolder.getXml())
outBoundProxy = ""
xmlBody.attributes.attr.each {
if(it.@name == 'outBoundProxy') {
outBoundProxy = it
}
}
log.info outBoundProxy
def props = testRunner.testCase.getTestStepByName( "Properties" )
def id = props.getPropertyValue("id");
def softswitchname = props.getPropertyValue("softswitchname");
log.info softswitchname
if ( softswitchname != outBoundProxy )
{
log.info("LIR APT NAKED - wrong softswitchname: $outBoundProxy")
testRunner.fail( "softswitchname" )
}
The result of the script is the following:
Wed Feb 27 09:24:56 CET 2013:INFO:outBoundProxy = 83.175.6.7
Wed Feb 27 09:24:56 CET 2013:INFO:softswitchname = 83.175.6.7
Wed Feb 27 09:24:56 CET 2013:INFO:LIR APT NAKED - wrong softswitchname: 83.175.6.7
Wed Feb 27 09:24:56 CET 2013:ERROR:Failed with reason [softswitchname]
I don't understand why the if test failed