Forum Discussion
meldoobs
12 years agoOccasional Contributor
i've been saving my responses to a .txt file using the following code in a groovy script (you need to replace myTestStepName and have project level property called Location with the file path you want to save to)
//get testSuite name
def filename = testRunner.testCase.testSuite.name
//get directory from Project Properties
def directory = testRunner.testCase.testSuite.project.getPropertyValue( "Location" )
//define the file location and name
def outputFile = new File(directory, "${filename}.txt")
//start writing stuff to it
outputFile.append( context.expand('${myTestStepName#Response}') )