TrueLog Sections

You can add sections to TrueLogs to add structure to complex scripts and to logically divide scripts into smaller named parts.

TrueLog sections can be nested and the same name can be used for multiple sections, which means the names do not have to be unique.

To create a new section in a TrueLog file, use the following code:
To close the last TrueLog section that was opened, use the following code:
Sections are automatically closed in the following cases:
  • The test case ends.
  • The test class ends.
  • The test run ends.
  • A keyword ends.
  • An exception occurs.
The following code sample demonstrates the usage of TrueLog sections:
public void subSections() {
  Desktop desktop = new Desktop();
  desktop.openTrueLogSection("Section a");
  desktop.logInfo("In section a");
  desktop.openTrueLogSection("Section b");
  desktop.logInfo("In section b");
  desktop.logInfo("In section a again");

For additional information on the supported methods, refer to the API documentation of your Silk Test client.