You can send the log of the entire test or any of its children logs via e-mail. TestComplete provides the following features, that you can use to send the test log via e-mail:
- Quick sending from the log context menu
- Sending from scripts
- Sending from keyword tests
You can send the test log via e-mail during the test execution by using any of the last two methods.
Quick Sending From the Log Context Menu
You can quickly send the log of the entire test run or any of its child logs via e-mail from the log node context menu.
In order for TestComplete to send test results via e-mail, a 32-bit MAPI (Messaging Application Programming Interface) compliant e-mail application must be installed on the computer.
To send results via e-mail:
-
Select the desired log node in the tree on the left of the test log page (if you select the root node, TestComplete will send the results of the whole run, if you select a subnode, the item will contain results shown by this subnodes and its child nodes).
-
Right-click the selected node and choose Send via E-mail from the context menu:
TestComplete will invoke the Send Log via E-Mail dialog.
-
In the dialog, clear the Save Visualizer images�check box if you do not need to send Visualizer images, or select the check box to send images along with the results (this can significantly increase the log size).
Click OK to send the e-mail.
TestComplete will pack the results to a Multipart Hypertext Storage file (.mht), attach it to the e-mail message and initiate the sending process. The further actions depend on the e-mail client used by default on your computer. For instance, Microsoft Outlook Express will first show the dialog, in which you can specify the recipients, and then display the message editor, in which you can modify the message text and attachments.
Test results are packed to an .mht file that is attached to the e-mail message. Since .mht files can not be secured, your e-mail client may open them in the Restricted sites mode and these files may display incorrectly. For more information on how to work around this problem, see Issue With Multipart Hypertext Files Sent via E-mail. |
Sending From Scripts
You can also send test results from scripts. To do this, follow these steps:
-
Use methods of the
slPacker
object to pack the test results to a file (it is easier to manage a single file then a group of files). You can call these methods from a keyword test, for instance, via the Call Object Method operation. For more information on how to pack results, see Archiving Results From Tests. -
Write script code that will send the test log. For more information on this, see Sending Email From Scripts.
Sending From Keyword Tests
There are two ways to send a test log via e-mail from a keyword test: you can add a sequence of keyword test operations to the test, which implements sending or you can implement log sending in a script routine and then run this routine from a keyword test. Below is the description of these ways:
-
Add a sequence of keyword test operations, for instance, the Call Object Method, Set Variable Value operations, to the test. Using these operations you can call the
slPacker
object’s methods, which allow to pack the log file and prepare it for sending. Then, using the same keyword test operations with Collaboration Data Objects’ (CDO) methods, you can create a mail message, attach the packed log file to it and send the prepared message. -
Write a script routine sending the test log. After the routine is ready, add the
Run Script Routine
operation to the test and specify the name of the created routine as the operation parameter. For information on how to implement sending in a script routine, see the previous section.
For more information on how to implement common tasks in keyword tests, see Common Tasks for Keyword Test Operations.
When to Send Results
If you run a single test, you can call a test command that sends test results directly from this test.
If your run a project with several test items and you need to send the entire test log via e-mail, there is no need to call the appropriate method or command from each test item. You just need to call the desired method from the last test item. For example, you can create a special routine that will send test results and add it to the Test Items page as the last test item.
See Also
BuiltIn.SendMail Method
Test Results
Archiving Results From Tests
Sending Email From Scripts
Managing Log Files
Exporting Test Results
Creating Issue Reports for Test Results
Common Tasks for Keyword Test Operations