Forum Discussion

kamahade's avatar
kamahade
Regular Contributor
14 years ago

testStep.run issue - Why this is NOT working ?

import com.eviware.soapui.support.*;

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
def testCase = testRunner.testCase;
def testStep = testCase.getTestStepByName("get_t_start");
testRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testCase, null);
testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep);

for (def i = 1; i <= 2; i++) {
def getter = groovyUtils.getXmlHolder("get_instances_name#Response")
getter.namespaces["axis2ns89099"] ="http://www.apache.org/ode/pmapi"
getter.namespaces["ns"]="http://www.apache.org/ode/pmapi/types/2006/08/02/"
def iid = getter.getNodeValue("//axis2ns89099:listInstancesResponse[1]/instance-info-list[1]/ns:instance-info[$i]/ns:iid[1]")
log.info iid
def get_t_startHolder = groovyUtils.getXmlHolder( "get_t_start#Request" )
get_t_startHolder.setNodeValue("//pmap:getCommunication/getCommunication/ns:iid",iid);
log.info get_t_startHolder.getNodeValue("//pmap:getCommunication/getCommunication/ns:iid");
testStep.run(testRunner, testStepContext);
}


I'm seeing in Log output :

Mon Nov 14 19:22:12 GMT 2011:INFO:35887649
Mon Nov 14 19:22:12 GMT 2011:INFO:35887649
Mon Nov 14 19:22:15 GMT 2011:INFO:35887946
Mon Nov 14 19:22:15 GMT 2011:INFO:35887946


However, teststep get_t_start while executing didnot have any value in node which I set.

1 Reply

  • Hi,

    I think you just need to call

    getter.updateProperty()

    to write your changes back to the actual request

    Does that help?

    regards!

    /Ole
    SmartBear Software