Forum Discussion
Manimaran
13 years agoOccasional Contributor
Hi,
i have used this code and it doesn't print the whole content available in the script log tab. i see some 18 lines of log content is available (each line is printed from the test case as test case log, the content is request and response). but only 15 lines of log content is printing in the file. Please help me if anything is missing.
def logArea = com.eviware.soapui.SoapUI.logMonitor.getLogArea( "script log" )
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectPath = groovyUtils.projectPath
def datetime = new Date().format("yyyy-MM-dd'T'HH-mm-ss SSS")
def logFile = new File(projectPath + "\\logs\\" + datetime + ".txt")
logFile.write("Script 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).toString() + "\r\n")
}
logFile.close()
}
}
i have used this code and it doesn't print the whole content available in the script log tab. i see some 18 lines of log content is available (each line is printed from the test case as test case log, the content is request and response). but only 15 lines of log content is printing in the file. Please help me if anything is missing.
def logArea = com.eviware.soapui.SoapUI.logMonitor.getLogArea( "script log" )
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectPath = groovyUtils.projectPath
def datetime = new Date().format("yyyy-MM-dd'T'HH-mm-ss SSS")
def logFile = new File(projectPath + "\\logs\\" + datetime + ".txt")
logFile.write("Script 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).toString() + "\r\n")
}
logFile.close()
}
}