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

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️Please mark my answer as a solution if it was helpful
New Here?
Join us and watch the welcome video:
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!

Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors