cancel
Showing results for 
Search instead for 
Did you mean: 

Clear groovy log window from groovy script

SOLVED
Contributor

Clear groovy log window from groovy script

Is is possible to clear the groovy log window from a groovy script?

How can i do that?

regards

Raymond Wiertz
1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Clear groovy log window from groovy script

Try this:

//Clear Script Logs
com.eviware.soapui.SoapUI.logMonitor.getLogArea("Script Log").clear()

 

For open source version check "Script Log" case... it is case sensitive.

 

thanks.

View solution in original post

5 REPLIES 5
Super Contributor

Re: Clear groovy log window from groovy script

Hi!

hmm.. try the following:

def logArea = com.eviware.soapui.SoapUI.logMonitor
if( logArea != null )
{
  def ix = logArea.indexOfTab( "groovy log" );
  if( ix >= 0 )
  {
      def logPanel = logArea.getComponentAt( ix )
      logPanel.logList.model.clear()
  }
}


This should be in a standard script-library in the future..

regards!

/Ole
eviware.com
Contributor

Re: Clear groovy log window from groovy script

Thanks,

Thats works fine.

regards,

Raymond Wiertz
Contributor

Re: Clear groovy log window from groovy script

hmm . it does nothing , any other scripts ?

Super Contributor

Re: Clear groovy log window from groovy script

The topic you replied to is very old, I guess from when Ready API was just SoapUI. I think the problem with the script above is the tab names within the GUI have changed since the original reply. The tab name is no longer called "groovy log", it is now "Script log".

 

It seems to work if you update the name of the tab in the script. Please note: I do not know if this is a recommended way of clearing the script log or if there is another better way. It seems a bit fragile to reference GUI labels in your script.

Contributor

Re: Clear groovy log window from groovy script

Try this:

//Clear Script Logs
com.eviware.soapui.SoapUI.logMonitor.getLogArea("Script Log").clear()

 

For open source version check "Script Log" case... it is case sensitive.

 

thanks.

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors