Hi Rao,
Thank you for responding.
I'm not sure if I understand exactly what you mean when you say "existing file". If you mean can the file that is created at the time the testcase is ran than yes. That is what I want to do, export the Script log to another directory.
As for a use case I have a SoapUI project that has multiple testcases. For each one I would like to be able to export the Script log to the project path with a file name like testcasename.log and I think it would be OK for it to be overwritten each time but it might be nice to turn that on and off also, if that is possible.
I have found a few solutions that are similar to this
/The below groovy script step is to capture the soapUI log area.
// "soapUI log" can be replaced with http log, jetty log, script log, error log etc based on the need.
def logArea = com.eviware.soapui.SoapUI.logMonitor.getLogArea( "soapUI log" );
//Below two lines of groovy script is to get the project directory, we will be saving the soapUI log contents on a file in that directory.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectPath = groovyUtils.projectPath
def logFile = new File(projectPath + "\\soapUI-Logs-to-file.txt")
//This is the first line in the soapUI log file.
logFile.write("soapUI Logs In a file.\r\n")
if( logArea !=null )
{
def model = logArea.model
if( model.size > 0 )
for( c in 0..(model.size-1) )
logFile.append(model.getElementAt( c ))
}
None of them seem to really work. I can see a file created but it's blank. From looking at this script I think if it worked it would accomplish what I need but not entirely sure since it's not working for me.