Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
15 years ago

How to export testcase name to a xml file via groovy

Hello,
How can I write a groovy script such that it export and appends the name of the test case to some xml file. for example I want my file to look some thing like


testcase1
testcase1
$#%Q#$%SFA<>fsaf

Thanks
Ali

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Ali!

    hmm.. from where in soapUI are you going to be running this script?

    regards,

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    i have testsuite tear down script. I would like to export the testcase names to a xml file.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    ok.. then something like the following:

    def file = new File( ... )
    file.write "
    for( testCase in testSuite.testCaseList )
    {
        file.write( "" + testCase.name + "" )
    }
    file.write "
    "
    file.close()

    works ok?

    regards,

    /Ole
    eviware.com