Forum Discussion
deepesh_jain
14 years agoFrequent Contributor
Hi,
The code that i mentioned would populate the complete request, not the highlighted portion. It would replace the complete xml in request. If you have to update specific nodes in the request xml. For that you will first have to load the request xml in a holder like below:
def gutils = new GroovyUtils ( context )
def holder = gutils.getXmlHolder("Publication Of Data#Request"); // This gets the request xml of your test step in a holder.
Now you can set any node in this xml like below:
holder.setNodeValue("//ns1:addClinicalDocument/ns1:recordTarget/ns1:patientRole",value1);
holder.updateProperty();
//Give the complete path of the node what you need to set in the quotes above.
Let me know if this works.
Thanks,
Deepesh Jain
The code that i mentioned would populate the complete request, not the highlighted portion. It would replace the complete xml in request. If you have to update specific nodes in the request xml. For that you will first have to load the request xml in a holder like below:
def gutils = new GroovyUtils ( context )
def holder = gutils.getXmlHolder("Publication Of Data#Request"); // This gets the request xml of your test step in a holder.
Now you can set any node in this xml like below:
holder.setNodeValue("//ns1:addClinicalDocument/ns1:recordTarget/ns1:patientRole",value1);
holder.updateProperty();
//Give the complete path of the node what you need to set in the quotes above.
Let me know if this works.
Thanks,
Deepesh Jain