Sending Email

If you would like to be notified about the results of your tests, or if you would like to be able to send emails based on information created or extracted from your website, Badboy makes this easy with the Send Email item.

Sending Emails is restricted in the free version of Badboy to emails of less than 50 characters. In order to send larger emails you need to purchase a license and enter your registration key using the "Enter License Key" option under Badboy's Help menu.

Creating Send Email Items

To create an item to send email in your script, just open the Toolbox and drag a "Send Email" item into your script at the point where you would like the email to be sent. The figure below shows how this looks:

Setting the Email Content

To set the content of the mail as well as the subject and recipients, open the Email Item properties by double clicking on it in your script. The figure below shows how this looks:

The Send Email item is actually the same as the Save item, but it is configured to send content as an email instead of saving it to a file. You can change any Save Item to a Send Item at any time just by changing the option from "File" to "Email" in the properties dialog.

Note that you can choose several different kinds of content:

  • To send a plain text message, select the "Expression" option in the properties and type your email into the field next to it.
  • To send the current page showing in the browser page by email, select the "Browser Content" option.
  • To send an HTML report of how your script played, select the "Script" option and then choose "HTML Report" in the drop down menu next to it. Badboy will send a beautifully formatted HTML summary of your script including all failures, assertions and screen shots as well!

Configuring your Email Settings

In order to send emails from your computer, Badboy must be configured with an SMTP server that it can use. To do this, open the preferences from the Preferences menu and choose the "Programs" tab, and then enter the details for your SMTP server. You should also enter a display name (this is the name that the recipient of the Email will see the email as being "From"), and a "From" address. Please note that if From address is not a real address belonging to the same domain as your network or your computer then your mail server may refuse to send the email.

If you do not know the address of your SMTP Server, ask your ISP or Network Administrator and they should be able to tell you.

Sending an Email from a File

A common need is to send an email that has it's content loaded from a file. This is easy to do by using a Variable Setters. First, add a Variable Setter and choose the "Load from File" option so that it loads it's content from a file. Then, add your "Send Email" item and choose the Expression option and set it to be the content of the variable.

The figure below shows how this might look:


Badboy Documentation Generated on Mon Dec 29 22:28:41 EST 2008