Class TestReport
Provides structured reporting functionality for Ranorex test suites.
public class TestReport
- Inheritance
-
TestReport
- Inherited Members
Constructors
TestReport()
public TestReport()
Properties
CurrentModuleGroupFolderActivity
Returns the ITestFolderActivity for the currently active module group folder.
public static ITestFolderActivity CurrentModuleGroupFolderActivity { get; }
Property Value
CurrentTestContainerActivity
Returns the Activity for the currently active 'test case' or 'smart folder'.
public static ITestContainerActivity CurrentTestContainerActivity { get; }
Property Value
Remarks
If called from a module at run time, this will be the first active ancestor 'test case' or 'smart folder'.
CurrentTestEntryIterationContainerActivity
Returns the ITestEntryIterationContainerActivity for the currently active activity run as an iteration.
public static ITestEntryIterationContainerActivity CurrentTestEntryIterationContainerActivity { get; }
Property Value
Remarks
If called from a module at run time, this will be one of the following. -The iteration container of the current ITestContainerActivity if it is run with 'data rows' or has an iteration count greater than 1. -The iteration container of the current ITestModuleActivity if the module has an iteration count greater than 1.
CurrentTestIterationActivity
Returns the active ITestIterableActivity of the currently active ITestEntryIterationContainerActivity.
public static ITestIterableActivity CurrentTestIterationActivity { get; }
Property Value
Remarks
The ITestIterableActivity represents the report activity of an TestSuiteEntry run as an iteration. This is usually the current ITestContainerActivity but may also be ITestModuleActivity.
CurrentTestModuleActivity
Returns the Activity for the currently active test module.
public static ITestModuleActivity CurrentTestModuleActivity { get; }
Property Value
CurrentTestModuleGroupActivity
Returns the Activity for the currently active test module group.
public static ITestModuleGroupActivity CurrentTestModuleGroupActivity { get; }
Property Value
CurrentTestSuiteActivity
Returns the Activity for the currently active test suite.
public static ITestSuiteActivity CurrentTestSuiteActivity { get; }
Property Value
EnableTracingScreenshots
Determines whether screenshots should be made for every step. This provides a number of screenshots in case an error occurs.
public static bool EnableTracingScreenshots { get; set; }
Property Value
MinimumJUnitReportLevel
Gets or sets the minimum ReportLevel that a message needs to have to be included in the JUnit report.
public static ReportLevel MinimumJUnitReportLevel { get; set; }
Property Value
- ReportLevel
The minimum report level that log entries need to have to be included in the JUnit report.
Remarks
The default level is Error.
ReportEnvironment
Provides access to all filenames and path used by the report.
public static ReportEnvironment ReportEnvironment { get; }
Property Value
ReportWriteInterval
The time interval for the current report to be saved to the target file.
public static Duration ReportWriteInterval { get; set; }
Property Value
ThumbImageWidth
The width (in pixels) of thumbnail images included in the report.
public static int ThumbImageWidth { get; }
Property Value
Remarks
The default value is 150px.
TracingScreenshotCountLocal
Gets or sets the number of tracing screenshots hold per module. The tracing screenshots are stored and shown in the report in case the module fails.
public static int TracingScreenshotCountLocal { get; set; }
Property Value
TracingScreenshotMode
Determines if tracing screenshots are taken in the background (non-blocking) or foreground (blocking).
public static TestReport.ScreenshotMode TracingScreenshotMode { get; set; }
Property Value
TracingScreenshotQuality
The JPEG quality for tracing screenshots (10-100, defaults to 40).
public static int TracingScreenshotQuality { get; set; }
Property Value
VideoRecording
Provides access to video recording functionality used by the test report
public static VideoRecording VideoRecording { get; }
Property Value
Methods
BeginSmartFolderContainer(string, string, ActivityExecType, int, IDictionary<string, string>, IDictionary<string, string>, string)
Creates a new TestContainerActivity of type SmartFolder and pushes it on the ActivityStack.
public static void BeginSmartFolderContainer(string containerName, string comment = null, ActivityExecType executeType = ActivityExecType.Execute, int iterationIndex = 1, IDictionary<string, string> dataRowOrParams = null, IDictionary<string, string> parametermasks = null, string iterationLabel = null)
Parameters
containerNamestringThe name of the 'smart folder'.
commentstringAdditional text for this test container. This will be displayed as detail under the activity name in the report.
executeTypeActivityExecTypeUsed to indicate the context the TestContainerActivity run in.
iterationIndexintThe index of the iteration (starts at one by convention).
dataRowOrParamsIDictionary<string, string>The current 'data row' or 'params' of the 'smart folder'
parametermasksIDictionary<string, string>The current mask status of the params
iterationLabelstringThe label of the iteration in report.
Remarks
For each BeginSmartFolderContainer(string, string, ActivityExecType, int, IDictionary<string, string>, IDictionary<string, string>, string) called, EndSmartFolderContainer() must be called, too.
BeginTestCaseContainer(string, string, ActivityExecType, int, IDictionary<string, string>, IDictionary<string, string>, string)
Creates a new TestContainerActivity of type TestCase and pushes it on the ActivityStack.
public static void BeginTestCaseContainer(string containerName, string comment = null, ActivityExecType executeType = ActivityExecType.Execute, int iterationIndex = 1, IDictionary<string, string> dataRowOrParams = null, IDictionary<string, string> parametermasks = null, string iterationLabel = null)
Parameters
containerNamestringThe name of the 'test case'.
commentstringAdditional text for this test container. This will be displayed as detail under the activity name in the report.
executeTypeActivityExecTypeUsed to indicate the context the TestContainerActivity run in.
iterationIndexintThe index of the iteration (starts at one by convention).
dataRowOrParamsIDictionary<string, string>The current 'data row' or 'params' of the 'smart folder'
parametermasksIDictionary<string, string>The mask status of the params
iterationLabelstringThe label of the iteration in report.
Remarks
For each BeginTestCaseContainer(string, string, ActivityExecType, int, IDictionary<string, string>, IDictionary<string, string>, string) called, EndTestCaseContainer() must be called, too.
BeginTestContainerSetup()
Creates a new Activity of type Setup container and pushes it on the ActivityStack.
public static void BeginTestContainerSetup()
BeginTestContainerTeardown()
Creates a new Activity of type Teardown container and pushes it on the ActivityStack.
public static void BeginTestContainerTeardown()
BeginTestEntryContainer(int, string, ActivityExecType, TestEntryActivityType)
Creates a new TestEntryContainerActivity and pushes it on the ActivityStack.
public static void BeginTestEntryContainer(int iterationIndex, string entryName, ActivityExecType executeType, TestEntryActivityType entryActivityType)
Parameters
iterationIndexintThe index of the iteration (starts at one by convention).
entryNamestringThe name of the TestSuiteEntry.
executeTypeActivityExecTypeThe ActivityExecType of this activity.
entryActivityTypeTestEntryActivityTypeThe TestEntryActivityType of this activity.
Remarks
For each BeginTestEntryContainer() called, EndTestEntryContainer() must be called, too.
BeginTestEntryIterationContainer(string, int, IterationExecType, TestEntryActivityType, string)
Creates a new ITestEntryIterationContainerActivity and pushes it on the ActivityStack.
public static void BeginTestEntryIterationContainer(string entryName, int iterationCount, IterationExecType iterationExecuteType, TestEntryActivityType entryActivityType, string comment = "")
Parameters
entryNamestringThe name of the entry that will be iterated over.
iterationCountintThe data or run iteration count
iterationExecuteTypeIterationExecTypeThe ActivityExecType of this activity..
entryActivityTypeTestEntryActivityTypeThe type of activity that will be iterated over
commentstringAdditional text for this test container. This will be displayed as detail under the activity name in the report.
Remarks
Call to BeginTestEntryIterationContainer(string, int, IterationExecType, TestEntryActivityType, string) are normally followed by multiple calls to: BeginSmartFolderContainer(string, string, ActivityExecType, int, IDictionary<string, string>, IDictionary<string, string>, string), BeginTestCaseContainer(string, string, ActivityExecType, int, IDictionary<string, string>, IDictionary<string, string>, string), BeginTestModule(string, int, ActivityExecType), or BeginTestEntryContainer(int, string, ActivityExecType, TestEntryActivityType).
For each BeginTestEntryIterationContainer() called, EndTestEntryIterationContainer() must be called, too.
BeginTestModule(string, int, ActivityExecType)
Creates a new TestModuleActivity and pushes it on the ActivityStack.
public static void BeginTestModule(string testModuleName, int iterationIndex = 1, ActivityExecType executeType = ActivityExecType.Execute)
Parameters
testModuleNamestringThe name of the test module.
iterationIndexintThe index of the iteration (starts at one by convention).
executeTypeActivityExecTypeThe ActivityExecType of this activity.
Remarks
If a test module is already on top of the stack, it is removed first (with default status).
BeginTestSuite(string)
Creates a new TestSuiteActivity and pushes it on the ActivityStack.
public static void BeginTestSuite(string testSuiteName)
Parameters
testSuiteNamestringThe name of the test suite.
BeginTestSuite(string, string)
Creates a new TestSuiteActivity and pushes it on the ActivityStack.
public static void BeginTestSuite(string testSuiteName, string runLabel)
Parameters
testSuiteNamestringThe name of the test suite.
runLabelstringAn optional run label. This will be displayed below the testsuite name in the report header section.
BeginTestSuite(string, string, IDictionary<string, string>)
Creates a new TestSuiteActivity and pushes it on the ActivityStack.
public static void BeginTestSuite(string testSuiteName, string runLabel, IDictionary<string, string> parameters)
Parameters
testSuiteNamestringThe name of the test suite.
runLabelstringAn optional run label. This will be displayed below the testsuite name in the report header section.
parametersIDictionary<string, string>A list of parameters for the test suite. This will be displayed as key/value pairs in the report header section.
Clear()
Clears the current test report, removing all information logged up to this point.
public static void Clear()
EndSmartFolderContainer()
Removes the current TestContainerActivity of type SmartFolder from the ActivityStack, with the result calculated from its child items.
public static void EndSmartFolderContainer()
EndSmartFolderContainer(TestResult)
Removes the current TestContainerActivity of type SmartFolder from the ActivityStack and updates its TestResult.
public static void EndSmartFolderContainer(TestResult result)
Parameters
resultTestResultThe TestResult of the completed test container.
EndTestCaseContainer()
Removes the current TestContainerActivity of type TestCase from the ActivityStack, with the result calculated from its child items.
public static void EndTestCaseContainer()
EndTestCaseContainer(TestResult)
Removes the current TestContainerActivity of type TestCase from the ActivityStack and updates its TestResult.
public static void EndTestCaseContainer(TestResult result)
Parameters
resultTestResultThe TestResult of the completed test container.
EndTestContainerSetup()
Removes the current Activity of type Setup from the ActivityStack.
public static void EndTestContainerSetup()
EndTestContainerSetup(TestResult)
Removes the current Activity of type Setup from the ActivityStack and updates its TestResult.
public static void EndTestContainerSetup(TestResult result)
Parameters
resultTestResultThe TestResult of the completed setup container.
EndTestContainerTeardown()
Removes the current Activity of type Teardown from the ActivityStack.
public static void EndTestContainerTeardown()
EndTestContainerTeardown(TestResult)
Removes the current Activity of type Teardown from the ActivityStack and updates its TestResult.
public static void EndTestContainerTeardown(TestResult result)
Parameters
resultTestResultThe TestResult of the completed test container teardown.
EndTestEntryContainer()
Removes the current ITestIterableActivity from the ActivityStack, with the result calculated from its child items.
public static void EndTestEntryContainer()
EndTestEntryContainer(TestResult)
Removes the current ITestIterableActivity from the ActivityStack and updates its TestResult.
public static void EndTestEntryContainer(TestResult result)
Parameters
resultTestResultThe TestResult of the completed test iteration.
EndTestEntryIterationContainer()
Removes the current Ranorex.Core.Reporting.TestEntryIterationContainerActivity from the ActivityStack, with the result calculated from its child items.
public static void EndTestEntryIterationContainer()
EndTestEntryIterationContainer(TestResult)
Removes the current Ranorex.Core.Reporting.TestEntryIterationContainerActivity from the ActivityStack and updates its TestResult.
public static void EndTestEntryIterationContainer(TestResult result)
Parameters
resultTestResultThe TestResult of the completed test container.
EndTestModule()
Removes the current TestModuleActivity from the ActivityStack. The module is marked as 'Failed' if the module contains any 'Failure' level messages.
public static void EndTestModule()
EndTestModule(TestResult)
Removes the current TestModuleActivity from the ActivityStack.
public static void EndTestModule(TestResult result)
Parameters
resultTestResultThe TestResult of the completed test module.
EndTestSuite()
Removes the current TestSuiteActivity from the ActivityStack, with the result calculated from its child items.
public static void EndTestSuite()
EndTestSuite(TestResult)
Removes the current TestSuiteActivity from the ActivityStack and updates its TestResult.
public static void EndTestSuite(TestResult result)
Parameters
resultTestResultThe TestResult of the completed test container.
HasTimePlaceholders(string)
Determines whether the specified path contains time-dependent placeholder values.
public static bool HasTimePlaceholders(string path)
Parameters
pathstringThe path.
Returns
- bool
trueif the specified path contains time-dependent placeholder values; otherwise,false.
SaveLocalScreenshotBuffer()
Saves all screenshots stored in the local screenshot buffer associated with the current test module activity.
public static void SaveLocalScreenshotBuffer()
Remarks
Note that this only works within an active TestModuleActivity and that only TracingScreenshotCountLocal screenshots are stored in the buffer and are discarded if new report items are added.
SaveReport()
Forces the current report to be saved to the configured file name.
public static void SaveReport()
SetCurrentTestResult(TestResult)
Sets the test result for the currently active test container or test module.
public static void SetCurrentTestResult(TestResult result)
Parameters
resultTestResultThe TestResult to set.
SetVideoRecordingProviderFactory(Func<IVideoRecordingProvider>)
Override the default IVideoRecordingProvider to be used with the test report.
public static void SetVideoRecordingProviderFactory(Func<IVideoRecordingProvider> factory)
Parameters
factoryFunc<IVideoRecordingProvider>A function returning a IVideoRecordingProvider on demand.
Setup(ReportLevel, string, bool)
Sets up the reporting environment.
public static void Setup(ReportLevel minLevel, string fileName, bool logToConsole)
Parameters
minLevelReportLevelThe minimum ReportLevel for messages that are to be written to the report.
fileNamestringName of the XML log file, or null if XML logging should be disabled.
logToConsoleboolIf set to
true, logging to console is enabled.
Setup(ReportLevel, string, bool, bool, Duration)
Sets up the reporting environment.
public static void Setup(ReportLevel minLevel, string fileName, bool logToConsole, bool enableTracingScreenshots, Duration writeInterval)
Parameters
minLevelReportLevelThe minimum ReportLevel for messages that are to be written to the report.
fileNamestringName of the XML log file, or null if XML logging should be disabled.
logToConsoleboolIf set to
true, logging to console is enabled.enableTracingScreenshotsboolDetermines whether screenshots should be made for every step. This provides a number of diagnostic screenshots in case of an error.
writeIntervalDurationThe time interval for the current report to be saved to the target file.
Setup(ReportLevel, string, bool, bool, Duration, string)
Sets up the reporting environment.
public static void Setup(ReportLevel minLevel, string fileName, bool logToConsole, bool enableTracingScreenshots, Duration writeInterval, string customReportFileLocation)
Parameters
minLevelReportLevelThe minimum ReportLevel for messages that are to be written to the report.
fileNamestringName of the XML log file, or null if XML logging should be disabled.
logToConsoleboolIf set to
true, logging to console is enabled.enableTracingScreenshotsboolDetermines whether screenshots should be made for every step. This provides a number of diagnostic screenshots in case of an error.
writeIntervalDurationThe time interval for the current report to be saved to the target file.
customReportFileLocationstringFolder containing custom report files.
Setup(ReportLevel, string, bool, string)
Sets up the reporting environment.
public static void Setup(ReportLevel minLevel, string fileName, bool logToConsole, string customReportFileLocation)
Parameters
minLevelReportLevelThe minimum ReportLevel for messages that are to be written to the report.
fileNamestringName of the XML log file, or null if XML logging should be disabled.
logToConsoleboolIf set to
true, logging to console is enabled.customReportFileLocationstringFile location for custom reports.