TestComplete 6 FAQ - Test Log and Results
This page contains answers to frequently asked questions about TestComplete ver. 4 - 6. For answers to questions on TestComplete 3, see TestComplete 3 FAQ.
Q.: When the test is over, TestComplete displays the test log window. Is it possible to change this behavior?
A.: Yes. Select Tools | Options from TestComplete’s main menu. Choose Engines | Log from the tree on the left of the Options dialog, and disable the Activate after test run option.
Q.: How can I take test results from TestComplete and send them to developers or to my boss?
A.: You can send the log of the entire test run or any of its child logs via e-mail. To do this:
- 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 subnode and its child nodes).
- Right-click the selected node and choose Send via E-mail from the context menu.
Sometimes there is a problem with .mht files: when you try to view it you
only see the empty window. This problem occurs because the operating system typically opens .mht files in the Restricted sites mode.
To work around the problem do the following:
- Save the attached .mht to hard disk.
- Open Windows Explorer and locate the saved file in it.
- Try viewing the file with Internet Explorer. If you can view the file, you are done. Else, right-click the file in the Windows Explorer and select Properties from the context menu. This will call the File Properties dialog.
- On the General page of the dialog click Unblock. Press OK to close the dialog.
Note that besides sending the results from the test log page, you can also send them from scripts. For more information on this, see “Sending E-mail From Scripts” help topic.
Q.: Why do the results load slowly in Internet Explorer?
A.: Unfortunately, the XML parser of Internet Explorer is too slow.
As a result, it takes a lot of time to open large XML files with the browser.
You should use the Log.LockEvents method in your scripts
to decrease the size of results: the test log does not contain event
messages after the script execution.
The Log.LockEvents method
has a parameter that equals 20 by default. It specifies the number of event
messages that will be kept in the buffer. If an error occurs, these messages
are posted to the Test Log. Please read the “Log.LockEvents” help
topic to learn more about this method. You can also browse large results
in TestComplete
using the Add Log File command of the Project Log (or Project Suite Log) node’s context
menu.
Q.: My test log is too large. Is there any way to decrease the amount of messages?
A.: The first thing you can do is lock event messages. For this purpose, use the Log.LockEvents method
--
Log.LockEvents(...) // Event messages
are not posted to the log
Log.UnlockEvents() // Event messages are posted
to the log
The second way is to compress the test log. To archive test results and files from your scripts, TestComplete provides the slPacker object. This object contains methods that let you compress results and files of the current test run. You can pack the current test run’s results at the end of the run, for instance, within the OnStopTest event handler. To compress the results, you can use the slPacker.PackCurrentTest method, which uses the configurations specified by the Script configuration option shown in the Packer Options dialog (Tools | Options | Engines | Packer ).
[VBScript]
Sub ProjectEvents1_OnStopTest(Sender)
slPacker.PackCurrentTest("C:\TestArchive\New")
End Sub
[JScript]
function ProjectEvents1_OnStopTest(Sender)
{
slPacker.PackCurrentTest("C:\\TestArchive\\New");
}
[DelphiScript]
procedure ProjectEvents1_OnStopTest(Sender: OleVariant);
begin
slPacker.PackCurrentTest('C:\TestArchive\New');
end;
[C++Script, C#Script]
function ProjectEvents1_OnStopTest(Sender)
{
slPacker["PackCurrentTest"]("C:\\TestArchive\\New");
}
Q.: When a test execution is finished TestExecute invokes an Internet Explorer window where test results are displayed. Can I prohibit this behaviour?
A.: Yes. This is controlled by the Activate after test run log option. If the option is disabled, TestExecute still generates test results, but it does not display them in the browser.
The option is available in the Log Options dialog. To call the dialog, right-click the TestExecute icon in the system tray, select Options from the context menu and then select Engines | Log from the tree displayed on the left side of the resulting Options dialog.
