To Do Comments Format and Syntax

Applies to TestComplete 15.63, last modified on April 23, 2024

When writing scripts in TestComplete, you may need to take a note of something (for example, of pre-designed corrections) in script. For this purpose, TestComplete provides script To Do comments which have a specific format. These comments are displayed in the To Do Panel.

This topic describes the format of the To Do comments and syntax specifics for different scripting languages and how to work with them from script.

To Do Comments Format

The To Do comments must have the following format:

// TODO (or DONE) Priority -cCategory -oOwner : DescriptionText
  • TODO - Indicates that correction needs to be done. The selected Done check box of the To Do Panel corresponds to this property of script comment.

    DONE - Indicates that correction have been realized. The cleared Done check box of the To Do Panel corresponds to this property of script comment.

    Note: TODO and DONE are alternative markers, that is, if you write both of them, only the first one will be applied. Note that you should specify either marker, otherwise the comment will not be displayed in the To Do panel.
  • Priority - Specifies the priority of the correction needed to be done. The value of this property is a decimal number. It is displayed in the Priority column of the To Do panel. If this property is omitted, 0 is set in the corresponding column of the To Do panel.
  • Category - Specifies a type of the required correction. The value of this property is displayed in the Category column of the To Do panel. This property is optional (it may contain space or be skipped).
  • Owner - Specifies a name of a person who must correct the problem. The value of this property is displayed in the Owner column of the To Do panel. This property is optional (it may contain space or be skipped).
  • DescriptionText - Specifies a description of the correction that needs to be done. The value of this property is displayed in the Description column of the To Do panel. This property is optional (it may contain space or be skipped).

To Do Comments Syntax

Scripting languages supported by TestComplete have different syntax for specifying To Do comments. These syntax specifics are described below.

  • In a JavaScript, JScript, DelphiScript, C#Script and C++Script unit, you can use this specific comment without any requirements.

    JavaScript, JScript

    // TODO 1 -cCategory1 -oJack :The correction description

    Log.Message("!!!"); // DONE 1 -cCategory1 -oJack :The correction description

    DelphiScript

    // TODO 1 -cCategory1 -oJack :The correction description

    Log.Message('!!!'); // DONE 1 -cCategory1 -oJack :The correction description

    C++Script, C#Script

    // TODO 1 -cCategory1 -oJack :The correction description

    Log["Message"]('!!!'); // DONE 1 -cCategory1 -oJack :The correction description

  • In Python, To Do comments must start with the number sign.

    Python

    # TODO 1 -cCategory1 -oJack :The correction description
      
    Log.Message("!!!"); # DONE 1 -cCategory1 -oJack :The correction description
  • To Do comments in VBScript code, like other VBScript comments, must start with an apostrophe or the Rem keyword:

    VBScript

    ' TODO 1 -cCategory1 -oJack :The correction description
    Log.Message "Hello" ' DONE 1 -cCategory1 -oJack :The correction description
     
     -- or --
     
    Rem TODO 1 -cCategory1 -oJack :The correction description
    Log.Message "Hello" Rem DONE 1 -cCategory1 -oJack :The correction description

Note: If the comment line contains text before the TODO or DONE markers, this comment will not be displayed in the To Do panel. However, if the text before TODO (or DONE) ends with a slash (/), the comment will be displayed in the panel, but the text will not be displayed. That is, it will not become a part of the comment text, it will be ignored.

For instance, the following comments will not be displayed in the To Do panel because, they have text before the TODO marker:

JavaScript, JScript

// The following comment will not be displayed:

// Some text TODO 1 -cCategory1 -oJack :The correction description

Python

# The following comment will not be displayed:
  
# Some text TODO 1 -cCategory1 -oJack :The correction description

VBScript

' The following comments will not be displayed:

' Some text TODO 1 -cCategory1 -oJack :The correction description

Rem Some text TODO 1 -cCategory1 -oJack :The correction description

DelphiScript

// The following comment will not be displayed:

// Some text TODO 1 -cCategory1 -oJack :The correction description

C++Script, C#Script

// The following comment will not be displayed:

// Some text TODO 1 -cCategory1 -oJack :The correction description

The following comments will be displayed in the To Do panel, but the text before the TODO marker will be ignored:

JavaScript, JScript

// The text before the TODO marker will not be displayed in the To Do panel:

// Some text // TODO 1 -cCategory1 -oJack :The correction description

Python

# The text before the TODO marker will not be displayed in the To Do panel:

# Some text # TODO 1 -cCategory1 -oJack :The correction description

VBScript

' The text before the TODO marker will not be displayed in the To Do panel:

' Some text // TODO 1 -cCategory1 -oJack :The correction description

Rem Some text // DONE 1 -cCategory1 -oJack :The correction description

DelphiScript

// The text before the TODO marker will not be displayed in the To Do panel:

// Some text // TODO 1 -cCategory1 -oJack :The correction description

C++Script, C#Script

// The text before the TODO marker will not be displayed in the To Do panel:

// Some text // TODO 1 -cCategory1 -oJack :The correction description

See Also

Code Editor
Script Tests
About the To Do Panel

Highlight search results