Table of Contents

Class ExecutionTracker

Namespace
Xping.Sdk.Core.Collection
Assembly
Xping.Sdk.Core.dll

Tracks test execution order, parallelization, and suite state across test runs. Thread-safe service enabling detection of order-dependent failures and parallel execution issues.

public sealed class ExecutionTracker
Inheritance
ExecutionTracker
Inherited Members

Constructors

ExecutionTracker()

Initializes a new instance of the ExecutionTracker class.

public ExecutionTracker()

Properties

ActiveWorkerCount

Gets the number of active workers/threads that have executed at least one test.

public int ActiveWorkerCount { get; }

Property Value

int

GlobalPosition

Gets the current global position counter (approximate in parallel scenarios).

public int GlobalPosition { get; }

Property Value

int

SuiteId

Gets the unique identifier for this test suite execution session.

public string SuiteId { get; }

Property Value

string

SuiteStartTime

Gets the start time of the test suite execution.

public DateTime SuiteStartTime { get; }

Property Value

DateTime

Methods

Clear()

Clears all tracking state. Useful for cleanup after test suite completion.

public void Clear()

CreateContext(string?, string?)

Creates an execution context for a test, tracking its position, previous test, and parallelization state.

public ExecutionContext CreateContext(string? workerId = null, string? collectionName = null)

Parameters

workerId string

Optional worker identifier (e.g., NUnit WorkerId, XUnit Collection). Falls back to thread ID if null.

collectionName string

Optional collection or fixture name for framework-specific grouping.

Returns

ExecutionContext

ExecutionContext containing order, parallelization, and suite state information.

GetPreviousTest(string?)

Gets the previous test information for a specific worker.

public TestExecutionInfo? GetPreviousTest(string? workerId = null)

Parameters

workerId string

Optional worker identifier. Falls back to thread ID if null.

Returns

TestExecutionInfo

Previous test information, or null if this is the first test for the worker.

GetWorkerPosition(string?)

Gets the position for a specific worker.

public int GetWorkerPosition(string? workerId = null)

Parameters

workerId string

Optional worker identifier. Falls back to thread ID if null.

Returns

int

Current position for the worker, or 0 if worker hasn't executed any tests.

RecordTestCompletion(string?, string, string, TestOutcome)

Records a test completion for tracking as the previous test in subsequent executions.

public void RecordTestCompletion(string? workerId, string testId, string testName, TestOutcome outcome)

Parameters

workerId string

Optional worker identifier. Falls back to thread ID if null.

testId string

Stable test identifier from TestIdentity.

testName string

Display name of the test.

outcome TestOutcome

Test outcome (Passed, Failed, Skipped, etc.).