0 Shares 629 Views

Test Log – TestComplete

May 20, 2013
629 Views

ResultAt the end of the automated test script execution, all we expect is a good nicely presented result report to analyse the tests quickly and in a better way. TestComplete offers ‘Test Log’, which contains details of all the actions performed during automated test runs. It contains all relevant information about the test run, such as the test name, the start and end time of the test run, the number of passed and failed test items, the total number of errors and warnings occurred, the results of each test operation and so on. Logs can also include images of the tested application, links to files and other kinds of entries.

Test Log is getting generated always and is opened by default at the end of each test execution. You can view all the test logs (current and previous) from Project Explorer. Logs can also be viewed when you pause the execution, if you have the ‘Show logs on pause’ option is enabled.

Features of Test Log

Detailed Log of actions performed: TestComplete generates a detailed test logs of all the actions performed, using which you can have a better analysis on the result, error and issues if any.

Fixing Errors easily: During the analysis, if you find an error or issue in your test script, test logs gives you ability to directly jump to the code statement where the issue occurs. A double-click on a log entry brings you to the corresponding automated test operation in your script.

Export to Other Formats:Logs can be viewed directly in TestComplete, or they can be exported to HTML, XML or MHT for viewing on machines that do not have TestComplete installed. You can also print test results, export them to a file, send them by e-mail or submit them to an issue-tracking system. You can export entire test log or a particular row, just right click the desired node in log tree or right click in the detail row and select export to option from the menu.

Filter results: Test Log displays Errors, Warning, Message, Event and Checkpoints. You can choose to display the information you are interested in or set to display all. Just select the required options to filter at test log panel.

Test Log Filter Options

Test Log Filter Options

Posting Information to Test Log

As you have seen above, Test Log contains all such information, we will now see how these information can be posted. You can post test log from your scripts using the Log object. Its methods allow you to insert items of different kinds into the test log as well as to create folders in the log. So for posting an error message call Error method, for Warning call Warning method and so on. for example to post an information into log, you will need to use

To post an error

Where pmNormal and pmHighest are the built-in constants for priority. The complete list of such constants is below.

Constant Value
pmLowest 100
pmLower 200
pmNormal 300
pmHigher 400
pmHighest 500

However, you can post the error, messages, warnings etc without these additional information too. for example –

Below tables list the properties and methods of Log Object, this is has been taken from smartbear website.

Property List

Name Description
CallStackSettings Provides scripting interfaces to settings that enables or disables the call stack tracing for methods that post messages to the log.
CheckpointCount Returns the number of checkpoint messages posted to the log by the current test item.
Enabled Specifies whether to allow the posting of folders and messages of all kinds to the test log.
ErrCount Returns the number of error messages posted to the log by the current test item.
EvnCount Returns the number of event messages posted to the log by the current test item.
FileCount Returns the number of file messages posted to the log by the current test item.
FolderCheckpointCount Returns the number of checkpoint messages posted to the specified log folder by the current test item.
FolderErrCount Returns the number of error messages posted to the specified log folder by the current test item.
FolderEvnCount Returns the number of event messages posted to the specified log folder by the current test item.
FolderFileAndLinkCount Returns the number of files and file links posted to the specified log folder by the current test item.
FolderImgCount Returns the number of image messages posted to the specified log folder by the current test item.
FolderMsgCount Returns the number of informative messages posted to the specified log folder by the current test item.
FolderWrnCount Returns the number of warning messages posted to the specified log folder by the current test item.
ImgCount Returns the number of image messages posted to the log by the current test item.
LinkCount Returns the number of file link messages posted to the log by the current test item.
MsgCount Returns the number of information messages posted to the log by the current test item.
Path Returns the name of the file (including the path) that holds a list of test results.
WrnCount Returns the number of warning messages posted to the log by the current test item.

Method List

Name Description
AppendFolder Creates a folder in the test log and activates the folder so that all posted messages are sent to this folder.
Checkpoint Posts a checkpoint message to the test log.
CreateFolder Creates a folder in the test log. This folder can hold messages of different types and subfolders.
CreateIssueFromCurrentLog Posts the log contents to an issue-tracking system.
CreateNewAttributes Creates a new object that defines font and color settings to be applied to test log messages and folders.
CreatePictureConfiguration Creates a new object that will specify the format settings for images posted to the test log.
Error Posts an error to the test log.
Event Posts an event to the test log.
File Posts a file to the test log.
FolderCount Returns the number of folders created in the log by the current test item.
Link Posts a reference to a file or to any other resource to the test log.
LockEvents Turns off event logging until UnlockEvents is called. The optional Count parameter sets the number of latest events to keep in a safety buffer. They will be added to the log when posting an error or warning message.
Message Posts an informative message to the test log.
Picture Posts an image to the test log.
PopLogFolder Pops the folder, which is currently at the top of the folder stack, out of the stack. This makes the folder that will be at the top of the stack the default folder of the test log.
PushLogFolder Pushes the specified folder to the top of the folder stack. As a result, by default, messages of different kinds will be posted to this folder and new folders will be created there.
SaveResultsAs Saves the current test log results to one or several files in a particular format.
SaveToDisk Generates intermediate test results and saves them to the log item collection.
SetDefaultPictureConfiguration Specifies the format settings for images posted to the test log.
UnlockEvents Re-enables event logging.
Warning Posts a warning to the test log.

So this was all about basic usage and features of Test Log, which will enable you to start working with test log in testcomplete. we will discuss other advanced topics and deep discussion on working with test logs in other posts. stay tuned.. subscribe to our updates by just entering your email id in the form below.

You may be interested

Setting up Mobile Automation Project in Windows
Katalon Studio
77 views
Katalon Studio
77 views

Setting up Mobile Automation Project in Windows

Saket - Sep 20, 2017

This tutorial explains how to setup a mobile automation project and test a mobile app using Katalon Studio on Windows. This tutorial assumes that you are familiar…

Katalon Studio GUI Overview
Katalon Studio
147 views2
Katalon Studio
147 views2

Katalon Studio GUI Overview

Saket - Sep 14, 2017

GUI Overview After installing and setting up Katalon Studio for your automated test, you must understand the GUI. In this post we will walk you through the…

LeanFT Tutorial #4: Application Model Overview
LeanFT
125 views1
LeanFT
125 views1

LeanFT Tutorial #4: Application Model Overview

Saket - Sep 10, 2017

In this post we are going to focus on Application Model in LeanFT. Refer our earlier posts on LeanFT Getting Ready with LeanFT Browser Extensions and Settings…

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...