Forum Discussion

hammer's avatar
hammer
Occasional Contributor
14 years ago

Question: reading external xml files

Hi,

i want to compare different XML-Files in SoapUI.
Via the TestStep "Property Transfer" i stored the Response in my testSuites Properties, named "Result". Then i stored the Response with the following code:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder(testRunner.testCase.testSuite.getPropertyValue("Result") );
File responseFile = new File("c:/test/out.txt")
responseFile.write(holder.prettyXml)

But i don't know how to read the XML. Can anybody help me?
Thanks a lot!
Hammer

// edit: like he did in http://www.eviware.com/forum/viewtopic.php?f=2&t=8314#p24056 <-- what is his readFile-Method doing?

1 Reply

  • hammer's avatar
    hammer
    Occasional Contributor
    okay... soon after posting i worked it myself:

    File testFile = new File("c:/test/out.txt")
    def test1 = testFile.getText();
    def reader = groovyUtils.getXmlHolder(test1 );