The EmailModule automatically sends an email at a desired point in a test run. You can use this module to distribute test results or reports to stakeholders immediately upon reaching a certain point or completion.
Add the module
To use the module, drag the EmailModule from the Module browser into the desired test container. Once the test run arrives at this point, it sends out the email as configured.
Configure the module
The module contains 14 predefined variables. You use these variables to configure the module. Some of them are mandatory, others optional.
To use these variables for configuration, you need to either create a data source that contains possible configuration values or create parameters with these values. You then bind each value to the respective variable. For more information, see Data-Driven Testing.
The variables are the following:
| Variable | Description |
| subject | Defines the subject line of the email. |
| body | Specifies the text content for the email message. |
| to | The email address of the recipient. |
| from | Defines the sender email address. |
| serverHostname |
SMTP name of the email server used to send the email. These usually follow the pattern “smtp.myserver.com”. Please consult your company’s tech support if you are unsure which email server to use. |
| serverPort | Specifies the port the email server uses to send the email. This is usually port 25. Please consult your company’s tech support if you are unsure which port to use. |
| useSSL | Enables SSL/TLS encryption for the connection when set to true. |
| username | Username for the email account used to send the email from. Normally not needed if the machine you run the test on is in the email server’s network domain and already logged into the email account, e.g. in Microsoft Outlook. |
| password | Password for the email account used to send the email. See username for more information. |
| sendEmailOnFailure | Sends the email only if the test fails at a point before the module when set to true. |
| sendEmailOnSuccess | Sends the email only if no failures have occurred before the module when set to true. |
| sendZippedReportOnComplete | Attaches the test report as a ZIP file when set to true. |
| sendPdfReportOnComplete | Attaches the PDF version of the test report if set to true. |
| pdfReportCustomStylesheet | Specifies the path to an XSL stylesheet you want to use to customize the PDF test report. |
Result
After running a test with the module, the report contains a log entry that also indicates whether a report was attached to the email.