Forum Discussion

Tim1988's avatar
Tim1988
New Contributor
16 years ago

How to transport the value from the script to the request

the request of the testStep requires two parameters,which are two Email Addresses.
in the script I defined like:
def Email="Jason@gmail.com";
def Email2='Mike@gmail.com";
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
def getXXXRequest = groovyUtils.getXmlHolder( 'getXXX#Request' );
getXXXRequest.setNodeValue("?",Email);
getXXXRequest.setNodeValue("?",Email2);
getXXXRequest.updatePropertyValue;
testRunner.RunTestStepByName("getXXX");

I don't konw how to figure out the different path of the two setNodeValue Action,since their tag's name are the same like //v1:EmailAddress,
is there a index can be used or something?

2 Replies

  • You could use the XPaths to the two nodes, since they would be different

    A simpler way would be to make the request as a separate test step, and use a property transfer to populate the values.

    /Nenad
    http://eviware.com
  • Tim1988's avatar
    Tim1988
    New Contributor
    eviware support wrote:
    You could use the XPaths to the two nodes, since they would be different

    A simpler way would be to make the request as a separate test step, and use a property transfer to populate the values.

    /Nenad
    http://eviware.com


    Got it ,thanks.