0
votes

I have created a Jenkins job to execute robot framework. The results[log.html and report.html] of the Jenkins are getting displayed properly.

Now I am using the email-ext plugin to send the log file as email content to the specified group of users, but the received email doesn't display the content and shows error as "Opening Robot Framework log failed" in the email.

I have set the email-ext plugin as follows:

enter image description here

I wish to send the robot results as email content, not as an attachment, I have tried various methods like Linux, shell scripting etc, but still, it doesn't work. How can the log.html email content can be sent to the email body?

2

2 Answers

2
votes

You will not be able to just put the entire content of the robot log.html in an email because it contains javascript.

I've been looking into this the last few days as well and have come to see that using a groovy based template using the jenkins Email-ext plugin is the way to go. Googling for 'jenkins robot framework email template' shows a few hits and one that I'm planning to try and then modify to my liking was this one:

https://github.com/vladwa/robot-email-template

From this I found that we don't have access to all of the test info built in, so I wrote up some modifications to load the robot output.xml as an artifact to then be able to inject any data in that file into the html email report. Here's the gist of that:

https://gist.github.com/harbdog/070f0be66ebae343d6d11e57a6c6fc08

Here's what it looks like for example: Example email report

0
votes

You have to configure publish robot framework test result <post build> and then use {ROBOT_REPORTLINK} in email content section