Forum Discussion
You can refer this link from TechCorner, hope it will help you out How To Modify XML
Hi Himanshu,
Thank you very much for your quick response.
I'm very new to Groovy and even looking for proper training too.
I tried the below logic but not able to traverse till "DocumentItemTypeCode" but i'm able to set value to "DocumentItemID" level.
import static java.util.UUID.randomUUID
import com.eviware.soapui.support.XmlHolder
def transactionID = "${java.util.UUID.randomUUID().toString().replaceAll('-','')}"
def reqOrder = testRunner.testCase.testSuite.testCases["Order"].testSteps["OrderItem"].getPropertyValue("Request")
def xmlOrder = new XmlHolder(reqOrder)
xmlOrder.setNodeValue("//inb:OrderItemMessageBulk/OrderItems/OrderItem/DocumentItemID", transactionID)
xmlOrder.setNodeValue("//inb:OrderItemMessageBulk/OrderItems/OrderItem/DocumentItemID('DocumentItemTypeCode'))", "GENO")
def xmlOrderNew = xmlOrder.getXml()
Kindly provide me a bit detail logic like what libraries to import and what syntax to be written because once i'm done with traverse till "DocumentItemTypeCode" then only i can be able to complete my work.
Regards,
Ramana.
Related Content
- 4 years ago
Recent Discussions
- 15 years ago