Philip Lazaro Philip Lazaro -4 years ago 153
Groovy Question

Capturing Script logs from a test case in SoapUI using groovy script

can someone help me with a script to capture script logs from a test case in soap UI using groovy scripting.

Answer Source

@canpan the below code worked for me,thanks for your continued help

'

def logArea = com.eviware.soapui.SoapUI.logMonitor.getLogArea("script log")
def LogFile = new File ("I:/SOAP UI/AutomationFramework/script.txt")
LogFile.write("Generating Script Logs...\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")
        }
    }
}

'

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download