Forum Discussion
ChrisA
5 years agoContributor
Hi,
Before looking at writing requests and responses, are you sure your script is correctly iterating over the test steps and 'picking' up the step name?
Try using log.info to check. E.g. in your loop....
testSuite.testCases.each { testCaseName, testCase ->
log.info("TestCaseName " + testCaseName);
// path for this testCase
def folderPathSuite = folderPath + testCaseName + File.separator;
new File(folderPathSuite).mkdir();
// for each testStep
testCase.testSteps.each { testStepName, testStep ->
log.info("TestStepName " + testStepName);
def response = testStep.getProperty('Response').getValue();
log.info(response);
if(response){
// define a file
def file = new File(folderPathSuite + testStepName + '_response.json')
// get the response and write to file
file.write(response)
}Sirisha2020
5 years agoContributor
The below code is not working and it is giving some errors