Events-Req/Res logging issue
Hi,
I want to export all my Request,response and test result in text file,so for that i created a Event in Project level and try to insert script and run the TC.I observed nothing is happened ,as per my script in my project location Log folder should create and inside that folder all different text file should be export.now i ran that Groovy script and i found 1 error but I am unable to fixed it,please help.I have attached SS detail for reference.
below is my script.
def prjpath = new com.eviware.soapui.support.GroovyUtils(context).projectPath
def logFolder = new File(prjpath +'/logs')
If(!logFolder.exists()){
LogFolder.mkdirs() //create a log folder
}
def tcName=testRunner.testCase.getName()
def tcFolder=new File(prjpath+"/logs/${tcName}")
If(!tcFolder.exists()){
tcFolder.mkdirs()
}
def FOS = new FileOutputStream(prjpath+"/logs/${tcName}"+testStepResult.testStep.name+'.txt',true) //create text file
def pw = new PrintWriter (FOS)
testStepResult.writeTo(pw)
pw.closed()
fos.closed()
yes,variables are case-sensitive.now it is working fine.