I am using SOAPUI for web service testing. I would like to do xml parsing via groovy script Test Step. For one test case, I have to insert xml tag [like <Email>xyz@gmail.com</Email>] in SOAP Request.
I can set value to xml tag using holder.setNodeValue(Xpath, Value), Using the same function I try to insert xml tag in SOAP request like holder.setNodeValue(Xpath, "<Email>xyz@gmail.com</Email>"). But in SOAP request xml tag set as
"<Email>xyz@gmail.com</Email>"
Because of this problem SOAP request not recognize that xml tag, Hence the value not get reflect /update in response.
Please correct me If I am using this function wrongly. Awaiting response from anyone..
Well that is happening because you are calling setNodeValue method. This method will set the value of the node (which can be of the XML node format).
Ideally, what you should have done is if node already exists () then just grab that node using holder and set the value.
Or
Or the simplest, add a empty property value in between the nodes.
Now say if you want to add email between name & phone, assign some value to that property variable.
And if not, then leave it empty.