Table of Contents

Class Reporter

Namespace
HP.LFT.Report
Assembly
HP.LFT.Report.dll

Provides the means to report custom events, additional data, and configuration for the report. This class cannot be inherited.

public static class Reporter
Inheritance
Reporter
Inherited Members

Properties

ReportConfiguration

The report configuration used for generating the report.

public static IReportConfiguration ReportConfiguration { get; }

Property Value

IReportConfiguration

ReportDescription

The report description. The description appears directly below the title in the report. By default, the description is empty.

public static string ReportDescription { get; set; }

Property Value

string

ReportLevel

The report level used to generate the report. Possible values: ReportLevel.

public static ReportLevel ReportLevel { get; set; }

Property Value

ReportLevel

ReportTitle

The report title. Default = Run Results.

public static string ReportTitle { get; set; }

Property Value

string

SnapshotCaptureLevel

The snapshot capture level used to generate the report.

public static CaptureLevel SnapshotCaptureLevel { get; set; }

Property Value

CaptureLevel

Possible values: CaptureLevel

Methods

AddRunInformation(string, string)

Adds a custom entry to the top section of the report.

public static void AddRunInformation(string fieldName, string fieldValue)

Parameters

fieldName string

The entry name.

fieldValue string

The entry value.

EndReportingContext()

Ends the section in the report.

public static void EndReportingContext()

EndTest(Status)

Ends the current test level and optionally sets the status for the test.

public static void EndTest(Status status = Status.Passed)

Parameters

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.

public static string GenerateReport()

Returns

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.).

public static Status GetCurrentExecutionContextStatus()

Returns

Status

The status of the current execution context as a ReportLevel object.

Init(ReportConfiguration)

Initializes the specified ReportConfiguration.

public static void Init(ReportConfiguration configuration)

Parameters

configuration ReportConfiguration

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.

public static void ReportEvent(string stepName, ReportAdditionalInfo reportAdditionalInfo)

Parameters

stepName string
reportAdditionalInfo ReportAdditionalInfo

ReportEvent(string, string)

Adds a custom step to the OpenText Functional Testing for Developers with default status "Passed".

public static void ReportEvent(string stepName, string description)

Parameters

stepName string

The name of the reported step. This name is the label of the step node in the report.

description string

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.

public static void ReportEvent(string stepName, string description, Status status, Image image)

Parameters

stepName string

The name of the reported step. This name is the label of the step node in the report.

description string

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.

public static void ReportEvent(string stepName, string description, Status status, Exception ex, Image image)

Parameters

stepName string

The name of the reported step. This name is the label of the step node in the report.

description string

The description of the reported step. The description is displayed in the Details pane of the report.

status Status

The Status for the step.

ex Exception

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.

public static void ReportEvent(string stepName, string description, Status status, Exception ex, string imagePath = "")

Parameters

stepName string

The name of the reported step. This name is the label of the step node in the report.

description string

The description of the reported step. The description is displayed in the Details pane of the report.

status Status

The Status for the step.

ex Exception

The exception that occurred.

imagePath string

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.

public static void ReportEvent(string stepName, string description, Status status, string imagePath = "")

Parameters

stepName string

The name of the reported step. This name is the label of the step node in the report.

description string

The description of the reported step. The description is displayed in the Details pane of the report.

status Status

The Status for the step.

imagePath string

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.

public static void ReportVerification(Status reportStatus, VerificationData verificationData)

Parameters

reportStatus Status

The Status for the verification.

verificationData VerificationData

The VerificationData data.

Exceptions

ArgumentNullException

verificationData is NULL.

StartReportingContext(string, ReportContextInfo)

Starts a named section in the report.

public static void StartReportingContext(string contextName, ReportContextInfo reportContextInfo)

Parameters

contextName string

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.

public static void StartReportingContext(string contextName, string contextDescription = "", IDictionary<string, object> additionalData = null)

Parameters

contextName string

The section name.

contextDescription string

Optional. The section description. Blank by default.

additionalData IDictionary<string, object>

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".

public static void StartScreenRecording()

StartScreenRecording(bool)

Starts a screen recording which will be saved to the report folder. The recording file format is ".avi".

public static void StartScreenRecording(bool useCompression)

Parameters

useCompression bool

if

true
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".

public static void StartScreenRecording(bool useCompression, string outputPath)

Parameters

useCompression bool

if

true
the recorded video represents a time lapse of the recorded scene, otherwise the full scene gets recorded
outputPath string

target location for the recorded video

StartScreenRecording(string)

Starts screen recording. Compression is ON. The recording file format is ".avi".

public static void StartScreenRecording(string outputPath)

Parameters

outputPath string

target location for the recorded video

StartTest(string, string)

Starts a new test level for the report.

public static void StartTest(string testName, string testDescription = "")

Parameters

testName string

The name of the test. This name is the label of the test node in the report.

testDescription string

The test description.

Remarks

Required only when using Reporter in a class that does not inherit from UnitTestBase.

StopScreenRecording()

Stops screen recording.

public static void StopScreenRecording()