Collapse Action (TreeList Controls)

Applies to TestComplete 15.64, last modified on June 12, 2024


The Collapse action collapses the specified tree list row. The effect is the same as if you clicked the “-” button of the row. The Collapse action does not move the mouse pointer.



TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Row [in]    Required    Integer    
Result None

Applies To

The method is applied to the following objects:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.


The method has the following parameter:


Specifies the zero-based index of the desired data row. The first visible row has the index 0, the second - 1, and so on. The index of the last row is wRowCount - 1.

Result Value



If the specified row is not found, Collapse fails and posts an error message to the log.

The script recorder recognizes mouse clicks on the “-” buttons within rows, and records the Collapse command.

See Also

Expand Action (TreeList Controls)

Highlight search results