Robot Framework Maven Plugin and OutOfMemoryError: Java heap space

I’m using and I have this OutOfMemoryError which occurs when generating log.html file from the output.xml file.

Apparently this is a known issue, but it has not yet been solved (as to my version 2.8.1 of the robot framework). This exception usually occurs on Jenkins where all our tests are executed.
The only workaround I was able to put in place is the use of to generate the logs.
This means that logs generation will not be performed by robotframework:run goal but by another goal we define in the pom. This would cause a problem because I still want to be able to run, on my machine a small subset of tests by invoking

  mvn  robotframework:run -Dinclude=sniff 

without executing all the maven phases. when running the small subset of tests, logs should be generated by robot directly (as the default behavior).
When running

  mvn verify  

on jenkins, logs should be generated as a separated step, by the rebot tool.

Here’s how I did this.
I create a profile called useRebotForLogs where we set the property to NONE and where we execute rebot in post-integration-test:

<!-- This profile is activated by the option -DuseRebotForLogs -->
   <id> use-rebot</id>
	<robot.log.file> NONE </robot.log.file>
                                   <echo message="${}# python -m rebot output.xml" />
				   <exec executable="python" dir="${}">
					<arg value="-m"/>
					<arg value="robot.rebot"/>
					<arg value="output.xml" />
				   <echo message="Robot logs were generated in ${} " />				


Another profile where we set the property robot.log.file to log.html:

<!-- This profile is activated by the option -DuseRebotForLogs is not present-->
			<id> generate-logs</id>
				<robot.log.file> ${}/robotframework-reports/log.html </robot.log.file>

Now, in the robotframework plugin configuration, we only specify the log file:


  <testCasesDirectory> src/test/resources/robotframework/tests</testCasesDirectory>

This is it.
Now, if run

  mvn verify -DuseRebotForLogs 

logs will be generated using rebot and we will not have OutOfMemory exception anymore.

This entry was posted in maven, robot framework, testing. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s