Showing results for 
Search instead for 
Did you mean: 

NullPointerException for logArea

Occasional Contributor

NullPointerException for logArea

In my Test Case setup script the first thing I do is clear the log
def logArea = com.eviware.soapui.SoapUI.logMonitor
logArea.getLogArea("script log").clear()
logArea.getLogArea("SoapUI log").clear()

I can run the TC without issues. However, when I try to run the TestCase from TestRunner it results in the error below

15:42:07,548 INFO  [SoapUIProTestCaseRunner] Running TestCase [Entit, TC 2.1 - Family 1]
15:42:08,075 ERROR [AbstractTestRunner] Exception during Test Execution
java.lang.NullPointerException: Cannot invoke method getLogArea() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(

Is there a way of getting the TC running and clearing the logs or do I have to skip clearing the logs by checking
if (!logArea.equals(null))

Re: NullPointerException for logArea


The Script log area is invalid when running using test runner, the logging is done to the command line console and to the log files. You can either check if test Runner is being used to the run the project or if (!logArea.equals(null)) as you listed to see if that log area is available.

SmartBear Support

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!