getSectionByTitle
report_section TPTReport.getSectionByTitle(string title)
This function retrieves a TPT report node identified by its title and reports it where it has been added.
Parameters:
title the section title to search for
Returns:
the report section or None
if no such section could be
found.
Examples:
TPTReport.add(TPTReport.Section("testsection1")) TPTReport.add(TPTReport.Section("testsection2")) TPTReport.add(TPTReport.Section("testsection3")) if TPTReport.getSectionByTitle("testsection2") != None: sec = TPTReport.getSectionByTitle("testsection2"); sec.add(TPTReport.Paragraph("here")) sec.add(TPTReport.Section("testsection2,1")) TPTReport.add(TPTReport.Paragraph("section got by title")) TPTReport.add(TPTReport.Section("testsection4")); else: TPT.setTestResult(TPT.FAILED)