Ask a Question

Change a request XML from Groovy

zitryss
Occasional Contributor

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

cancel
Showing results for 
Search instead for 
Did you mean: