XML - Parameterization - setPropertyValue - setNodeValue
I am trying to parameterize an XML in SoapUI using groovy language.
I am able to hit the endpoint and receive the response.
The issue is that, the parameters are received from the excel sheet and use to update the XML nodes. but, the values are not updated.
CODE:
if (reqTagName == "NumberA") {
log.info writableSheet.getCell(Col,Row).getContents() // able to read contents successfully
testRunner.testCase.setPropertyValue("NumberA", writableSheet.getCell(Col,Row).getContents());
}
if (reqTagName == "NumberB") {
log.info writableSheet.getCell(Col,Row).getContents() // able to read contents successfully
testRunner.testCase.setPropertyValue("NumberB", writableSheet.getCell(Col,Row).getContents());
}
if (ColumnCount!=0) {
String reqTagValue = writableSheet.getCell(Col,Row).getContents()
if (reqTagValue.length()>0) {
reqholder.setNodeValue("//*:"+reqTagName, reqTagValue)
reqholder.updateProperty();
}
XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA>${#TestCase#NubmerA}</tem:intA>
<tem:intB>${#TestCase#NumberB}</tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>
Excelsheet:
Test_ID | NumberA | NumberB | Operation | ExecutionStatus |
TC_0001 | 19 | 20 | ADD | Yes |
XML that is generated:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA></tem:intA>
<tem:intB></tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>
Please help me with this issue