0
votes

I am having 2 test cases in my suite. First test case contains 1 test step with xml request. Second test case contains 1 test step with groovy script. I want to run the 1st test case from this groovy script a number of times. Every time I want to change the input XML. I am unable to update the input XML in TestCase 1. I have the following the code for the groovy script:

import com.eviware.soapui.support.XmlHolder
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
def tsuite = testRunner.testCase.testSuite
def acctInq_tstepName = tsuite.getTestCaseAt(1).getTestStepAt(0).getName()
def acctInq_requestHolder = tsuite.getTestCaseAt(1).testSteps[acctInq_tstepName].testRequest.getRequestContent()
def acctInq_req = groovyUtils.getXmlHolder("$acctInq_requestHolder")
acctInq_req["//soapenv:Envelope[1]/soapenv:Body[1]/v2:AcctInqRq[1]/ifx:DepAcctId[1]/ifx:AcctId[1]"] = "0009917812344"
acctInq_req.updateProperty()

I also tried using

tstep.setPropertyValue("request",cStr(acctInq_req))

In either case the XML is not getting updated. Please help.

1
Please let us know what you expected to happen and what actually happened. Specific information such as actual output can be very useful as the community tries to help you. - Jeff Wolski
I am expecting the original request xml to get updated so that I can run the test step with new xml. But the xml is not getting updated. - Ramyaa Seetharaman
If you can provide the initial XML and the fields that you want to update, I will try to help you. - Suha

1 Answers

0
votes

Try set node value like below and check if it fixed the issue:

acctInq_req.setNodeValue("//*:ifx:AcctId[1]", "0009917812344")