Class TestStep
This record represents a step in a test execution. It provides a set of properties that can be used to store information about the step, such as its name, start date, duration, result, and error message.
[Serializable]
public sealed record TestStep : ISerializable, IEquatable<TestStep>
- Inheritance
-
TestStep
- Implements
- Inherited Members
Remarks
This record can be serialized and its state can be saved using serializers that support the ISerializable interface.
Constructors
TestStep()
Initializes a new instance of the TestStep class.
public TestStep()
TestStep(SerializationInfo, StreamingContext)
Initializes a new instance of the TestStep class with serialized data.
public TestStep(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe SerializationInfo that holds the serialized object data about the test step.
context
StreamingContextThe StreamingContext that contains contextual information about the source or destination.
Properties
Duration
Gets or sets the duration of the test step.
public required TimeSpan Duration { get; init; }
Property Value
ErrorMessage
Gets or sets the error message of the test step.
public string? ErrorMessage { get; init; }
Property Value
Name
Gets the name of the test step.
public required string Name { get; init; }
Property Value
PropertyBag
Gets or sets the property bag of the test session.
public required PropertyBag<IPropertyBagValue>? PropertyBag { get; init; }
Property Value
- PropertyBag<IPropertyBagValue>
A PropertyBag<IPropertyBagValue> object that contains key-value pairs of various data related to the test operation, such as resolved IP addresses from DNS lookup, HTTP response headers, HTML content, or captured screenshots from the headless browsers.
Remarks
This property bag requires all objects to inherit from the IPropertyBagValue interface, so that they can be serialized and deserialized using the serializers that support the ISerializable interface. This enables the property bag to be saved and loaded to and from XML writers and readers.
Result
Gets or sets the result of the test step.
public required TestStepResult Result { get; init; }
Property Value
- TestStepResult
A TestStepResult enumeration value that indicates the result of the test step.
StartDate
Gets the start date of the test step.
public required DateTime StartDate { get; init; }
Property Value
TestComponentIteration
Gets the iteration count of the test component that created this test step.
public required int TestComponentIteration { get; init; }
Property Value
- int
The number of test steps previously created by the same test component during the test execution, indicating the order of this test step in the sequence of iterations.
Type
Gets or sets the type of the test step.
public required TestStepType Type { get; init; }
Property Value
- TestStepType
A TestStepType enumeration value that indicates the type of the test step.
Methods
ToString()
Returns a string that represents the current TestStep object.
public override string ToString()
Returns
- string
A string that represents the current object.