Class Reporter
Provides the means to report custom events, additional data, and configuration for the report. This class cannot be inherited.
Inherited Members
Namespace: HP.LFT.Report
Assembly: HP.LFT.Report.dll
Syntax
public static class Reporter
Properties
ReportConfiguration
The report configuration used for generating the report.
Declaration
public static IReportConfiguration ReportConfiguration { get; }
Property Value
| Type | Description |
|---|---|
| IReportConfiguration |
ReportDescription
The report description. The description appears directly below the title in the report. By default, the description is empty.
Declaration
public static string ReportDescription { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ReportLevel
The report level used to generate the report.
Declaration
public static ReportLevel ReportLevel { get; set; }
Property Value
| Type | Description |
|---|---|
| ReportLevel |
ReportTitle
The report title. Default = Run Results.
Declaration
public static string ReportTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SnapshotCaptureLevel
The snapshot capture level used to generate the report.
Declaration
public static CaptureLevel SnapshotCaptureLevel { get; set; }
Property Value
| Type | Description |
|---|---|
| CaptureLevel | Possible values: CaptureLevel |
Methods
AddRunInformation(string, string)
Adds a custom entry to the top section of the report.
Declaration
public static void AddRunInformation(string fieldName, string fieldValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldName | The entry name. |
| string | fieldValue | The entry value. |
EndReportingContext()
Ends the section in the report.
Declaration
public static void EndReportingContext()
EndTest(Status)
Ends the current test level and optionally sets the status for the test.
Declaration
public static void EndTest(Status status = Status.Passed)
Parameters
| Type | Name | Description |
|---|---|---|
| Status | status | Optional. The Status for the current test. Default = Passed. |
Remarks
Required only when using Reporter in a class that does not inherit from UnitTestBase.
GenerateReport()
Generates the report.
Declaration
public static string GenerateReport()
Returns
| Type | Description |
|---|---|
| string | The path of the generated report folder. |
Remarks
Required only when using IReporter in a test class that does not inherit from UnitTestBase.
GetCurrentExecutionContextStatus()
Returns the status of the current execution context. The execution context is equivalent to any superior structure that contains operations (e.g.: test method, reporting context, etc.).
Declaration
public static Status GetCurrentExecutionContextStatus()
Returns
| Type | Description |
|---|---|
| Status | The status of the current execution context as a ReportLevel object. |
Init(ReportConfiguration)
Initializes the specified ReportConfiguration.
Declaration
public static void Init(ReportConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| ReportConfiguration | configuration | The configuration to use for the report. |
Remarks
Required only when using IReporter in a test class that does not inherit from UnitTestBase.
ReportEvent(string, ReportAdditionalInfo)
Adds a custom step to the OpenText Functional Testing for Developers including the information about the step as a ReportAdditionalInfo object.
Declaration
public static void ReportEvent(string stepName, ReportAdditionalInfo reportAdditionalInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | |
| ReportAdditionalInfo | reportAdditionalInfo |
ReportEvent(string, string)
Adds a custom step to the OpenText Functional Testing for Developers with default status "Passed".
Declaration
public static void ReportEvent(string stepName, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
ReportEvent(string, string, Status, Image)
Adds a custom step to the report including the provided image object.
Declaration
public static void ReportEvent(string stepName, string description, Status status, Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| Image | image | The Image to use for the step. |
ReportEvent(string, string, Status, Exception, Image)
Adds a custom step to the OpenText Functional Testing for Developers including the provided exception and image object.
Declaration
public static void ReportEvent(string stepName, string description, Status status, Exception ex, Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| Exception | ex | The exception that occurred. |
| Image | image | The Image to use for the step. |
ReportEvent(string, string, Status, Exception, string)
Adds a custom step to the OpenText Functional Testing for Developers including exception details and the image from the specified path.
Declaration
public static void ReportEvent(string stepName, string description, Status status, Exception ex, string imagePath = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| Exception | ex | The exception that occurred. |
| string | imagePath | The full path of the image to display for the step. Supported image types: BMP, GIF, JPEG, PNG, TIFF |
ReportEvent(string, string, Status, string)
Adds a custom step to the report including the image from the specified path.
Declaration
public static void ReportEvent(string stepName, string description, Status status, string imagePath = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| string | imagePath | The full path of the image to display for the step. Supported image types: BMP, GIF, JPEG, PNG, TIFF |
ReportVerification(Status, VerificationData)
Adds a custom verification step to the report.
Declaration
public static void ReportVerification(Status reportStatus, VerificationData verificationData)
Parameters
| Type | Name | Description |
|---|---|---|
| Status | reportStatus | The Status for the verification. |
| VerificationData | verificationData | The VerificationData data. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
StartReportingContext(string, ReportContextInfo)
Starts a named section in the report.
Declaration
public static void StartReportingContext(string contextName, ReportContextInfo reportContextInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | The section name. |
| ReportContextInfo | reportContextInfo | The ReportContextInfo object which contains the information to describe the section. |
StartReportingContext(string, string, IDictionary<string, object>)
Starts a named section in the report.
Declaration
public static void StartReportingContext(string contextName, string contextDescription = "", IDictionary<string, object> additionalData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | The section name. |
| string | contextDescription | Optional. The section description. Blank by default. |
| IDictionary<string, object> | additionalData | Optional. The dictionary containing additional custom information. Blank by default. |
StartScreenRecording()
Starts a screen recording which will be saved to the report folder. Compression is ON. The recording file format is ".avi".
Declaration
public static void StartScreenRecording()
StartScreenRecording(bool)
Starts a screen recording which will be saved to the report folder. The recording file format is ".avi".
Declaration
public static void StartScreenRecording(bool useCompression)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | useCompression | if the recorded video represents a time lapse of the recorded scene, otherwise the full scene gets recorded
|
StartScreenRecording(bool, string)
Starts screen recording. The recording file format is ".avi".
Declaration
public static void StartScreenRecording(bool useCompression, string outputPath)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | useCompression | if the recorded video represents a time lapse of the recorded scene, otherwise the full scene gets recorded
|
| string | outputPath | target location for the recorded video |
StartScreenRecording(string)
Starts screen recording. Compression is ON. The recording file format is ".avi".
Declaration
public static void StartScreenRecording(string outputPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | outputPath | target location for the recorded video |
StartTest(string, string)
Starts a new test level for the report.
Declaration
public static void StartTest(string testName, string testDescription = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | testName | The name of the test. This name is the label of the test node in the report. |
| string | testDescription | The test description. |
Remarks
Required only when using Reporter in a class that does not inherit from UnitTestBase.
StopScreenRecording()
Stops screen recording.
Declaration
public static void StopScreenRecording()