Forum Discussion

CarloCGI's avatar
13 years ago

Read a xml file and put it in your regeust window

Hi there,

could somebody help how me you can a read a xml file with groovy and place the content in your reguest window

thanks in advance

1 Reply


  • import java.io.File;

    new File('pathToYourFiles').traverse {
    file ->
    log.info 'Reading file ' + file

    testcase = testRunner.testCase.testSuite.project.testSuites['YourTestSuiteName'].testCases['YourTestCaseName']
    testcase.testSteps['YourRequestName'].getProperty('Request').setValue(file.getText())

    //run the request before setting the next file
    testcase.run(null, false)
    }