With the EmailModule, you can have your test send out an email at a desired point in the test run automatically and even attach the report to it. This is useful for getting notifications when a long test has reached a certain point or to automatically send out test results to several people.
On this page
Simply drag the module from the module browser to the desired test container. Once the test run arrives at this point, it will send out the email as configured (see further below for mandatory configuration).
In the above image, we added the module to the teardown section of the test case Test_introduction_functions, after the module that closes the AUT. We configured it to send out an email informing us that the AUT has been closed.
The module contains 14 predefined variables. They are used 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.
Data sources, parameters, and data binding are explained in
Ranorex Studio fundamentals > ⇢ Data-driven testing
Here are all the variables and which values they accept:
The subject line of the email.
The main text of the email.
The email address of the recipient.
The email address of the account you want to send the email from.
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.
The port the email server will use to send the email. This is usually port 25. Please consult your company’s tech support if you are unsure which port to use.
Whether to use SSL encryption. Possible values: true, false.
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 for the email account used to send the email from. See Username for more information.
Only sends the email if a failure has occurred at a point prior to the module. Possible values: true, false.
Only sends the email if no failures have occurred prior to the module. Possible values: true, false.
Attaches the test report as a ZIP file. Possible values: true, false.
Attaches the test report as a PDF file. Possible values: true, false.
Path to an XSL stylesheet you want to use to customize the PDF test report.
After running a test with the module, the report contains a log entry that will also indicate whether a report was attached to the email.