Forum Discussion

zitryss's avatar
zitryss
Occasional Contributor
10 years ago

Change a request XML from Groovy

Hello everyone,

 

currently I am experimenting with Groovy and looking for the way to write the prettyfied XML back in the Request of Mock Response test step. Here is what I already have:

 

def non_formatted_xml = context.expand('${Mock Response#Request}')
def formatted_xml = groovy.xml.XmlUtil.serialize(non_formatted_xml)

As you may see there is only one last operation missing. Does anyone know how to write XML back? 

 

P.S. Thank you in advance for any help you can provide!

 

Sincerely,

Eugene

No RepliesBe the first to reply