OpenTAP 9.34
API Reference
OpenTap.TestPlan Class Reference

Class containing a test plan. More...

Inheritance diagram for OpenTap.TestPlan:
OpenTap.ITestStepParent

Classes

class  PlanLoadException
 Exception occuring when a test plan loads. More...
 

Public Member Functions

void FlushXmlCache ()
 Flushes the test plan XML cache.
 
byte[] GetCachedXml ()
 Get the cached XML (or null if it is not cached)
 
void Save (Stream stream, TapSerializer serializer)
 Saves this TestPlan to a stream with a specific serializer.
 
void Save (Stream stream)
 Saves this TestPlan to a stream;.
 
void Save (string filePath)
 Saves this TestPlan to a file path.
 
TestPlan Reload (Stream filestream)
 Reload a TestPlan transferring the current execution state of the current plan to the new one.
 
TestPlanRun Execute ()
 Blocking Execute TestPlan. Uses ResultListeners from ResultSettings.Current.
 
Task< TestPlanRunExecuteAsync ()
 Executes the test plan asynchronously.
 
Task< TestPlanRunExecuteAsync (CancellationToken abortToken)
 Executes the test plan asynchronously.
 
Task< TestPlanRunExecuteAsync (IEnumerable< IResultListener > resultListeners, IEnumerable< ResultParameter > metaDataParameters, HashSet< ITestStep > stepsOverride, CancellationToken cancellationToken)
 Execute the TestPlan as specified.
 
TestPlanRun Execute (IEnumerable< IResultListener > resultListeners, IEnumerable< ResultParameter > metaDataParameters=null, HashSet< ITestStep > stepsOverride=null)
 Execute the TestPlan as specified. Blocking.
 
TestPlanRun Execute (IEnumerable< IResultListener > resultListeners, IEnumerable< ResultParameter > metaDataParameters)
 Execute the TestPlan as specified. Blocking.
 
void Open ()
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources.
 
void Open (IEnumerable< IResultListener > listeners)
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources.
 
void Open (IEnumerable< IResource > additionalResources)
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources.
 
void Open (IEnumerable< IResultListener > listeners, IEnumerable< IResource > additionalResources)
 Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources.
 
void Close ()
 Closes all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This should be called if TestPlan.Open() was called earlier to manually close the resources again.
 

Static Public Member Functions

static TestPlan Load (string filePath)
 Load a TestPlan.
 
static TestPlan Load (string filePath, bool cacheXml)
 Load a TestPlan.
 
static TestPlan Load (Stream stream, string path)
 Load a TestPlan.
 
static TestPlan Load (Stream stream, string path, bool cacheXml, TapSerializer serializer=null)
 Load a TestPlan.
 
static List< string > GetPluginsRequiredToLoad (string filepath)
 Returns the list of plugins that are required to use the test plan.
 

Protected Member Functions

virtual void OnPropertyChanged (string name)
 When a property changes this function is called.
 

Properties

ExternalParameters ExternalParameters [get]
 Field for external test plan parameters.
 
TestStepList Steps [get, set]
 Gets or sets a list of child TestSteps.
 
TestStepList ChildTestSteps [get]
 Gets a list of child TestSteps.
 
ITestStepParent Parent [get, set]
 Always null for test plan.
 
ReadOnlyCollection< ITestStepEnabledSteps [get]
 Gets the subset of steps that are enabled.
 
string Name [get]
 Gets or sets the name. This is usually the name of the file where the test plan is saved, without the .TapPlan extension.
 
bool IsInBreak [get]
 True if the test plan is waiting in a break.
 
bool Locked [get, set]
 Locks the TestPlan to signal that it should not be changed. The GUI respects this.
 
bool IsRunning [get]
 True if this TestPlan is currently running.
 
bool AllowEditWhilePaused [get, set]
 Can be set to true to allow editing the test plan while it's paused.
 
bool AllowEdit [get]
 Gets if the test plan is currently editable. This will never be true if the test plan is running(not paused) or locked.
 
bool CacheXml [get, set]
 Gets or sets if the test plan XML for this test plan should be cached.
 
string Path [get]
 Gets where this plan was last saved or loaded from. It might be null.
 
string Directory [get]
 The directory where the test plan is stored.
 
bool PrintTestPlanRunSummary [get, set]
 When true, prints the test plan run summary at the end of a run.
 
bool IsOpen [get]
 true if the plan is in its open state.
 
- Properties inherited from OpenTap.ITestStepParent

Events

EventHandler< BreakOfferedEventArgsBreakOffered
 A synchronous event that allows breaking the execution of the TestPlan by blocking the TestPlan execution thread. It is raised prior to executing the TestStep.Run method of each TestStep in the TestPlan. TestSteps may also raise this event from inside the TestStep.Run method.

 
PropertyChangedEventHandler PropertyChanged
 Event handler to on property changed.
 

Detailed Description

Class containing a test plan.

Member Function Documentation

◆ Execute() [1/3]

TestPlanRun OpenTap.TestPlan.Execute ( )
inline

Blocking Execute TestPlan. Uses ResultListeners from ResultSettings.Current.

Returns
Result of test plan run as a TestPlanRun object.

◆ Execute() [2/3]

TestPlanRun OpenTap.TestPlan.Execute ( IEnumerable< IResultListener > resultListeners,
IEnumerable< ResultParameter > metaDataParameters )
inline

Execute the TestPlan as specified. Blocking.

Parameters
resultListenersResultListeners for result outputs.
metaDataParametersMetadata parameters.
Returns
TestPlanRun results, no StepResults.

◆ Execute() [3/3]

TestPlanRun OpenTap.TestPlan.Execute ( IEnumerable< IResultListener > resultListeners,
IEnumerable< ResultParameter > metaDataParameters = null,
HashSet< ITestStep > stepsOverride = null )
inline

Execute the TestPlan as specified. Blocking.

Parameters
resultListenersResultListeners for result outputs.
metaDataParametersOptional metadata parameters.
stepsOverrideSub-section of test plan to be executed. Note this might include child steps of disabled parent steps.
Returns
TestPlanRun results, no StepResults.

◆ ExecuteAsync() [1/3]

Task< TestPlanRun > OpenTap.TestPlan.ExecuteAsync ( )
inline

Executes the test plan asynchronously.

Returns
A task returning the test plan run.

◆ ExecuteAsync() [2/3]

Task< TestPlanRun > OpenTap.TestPlan.ExecuteAsync ( CancellationToken abortToken)
inline

Executes the test plan asynchronously.

Parameters
abortTokenThis abort token can be used to abort the operation.
Returns
A task returning the test plan run.

◆ ExecuteAsync() [3/3]

Task< TestPlanRun > OpenTap.TestPlan.ExecuteAsync ( IEnumerable< IResultListener > resultListeners,
IEnumerable< ResultParameter > metaDataParameters,
HashSet< ITestStep > stepsOverride,
CancellationToken cancellationToken )
inline

Execute the TestPlan as specified.

Parameters
resultListenersResultListeners for result outputs.
metaDataParametersOptional metadata parameters.
stepsOverrideSub-section of test plan to be executed. Note this might include child steps of disabled parent steps.
cancellationTokenCancellation token to abort the testplan
Returns
TestPlanRun results, no StepResults.

◆ GetPluginsRequiredToLoad()

static List< string > OpenTap.TestPlan.GetPluginsRequiredToLoad ( string filepath)
inlinestatic

Returns the list of plugins that are required to use the test plan.

Parameters
filepath
Returns

◆ Load() [1/4]

static TestPlan OpenTap.TestPlan.Load ( Stream stream,
string path )
static

Load a TestPlan.

Parameters
streamThe stream from which the file is actually loaded.
pathThe path to the file. This will be tha value of TestPlan.Path on the new TestPlan.
Returns
Returns the new test plan.

◆ Load() [2/4]

static TestPlan OpenTap.TestPlan.Load ( Stream stream,
string path,
bool cacheXml,
TapSerializer serializer = null )
inlinestatic

Load a TestPlan.

Parameters
streamThe stream from which the file is actually loaded.
pathThe path to the file. This will be tha value of TestPlan.Path on the new TestPlan.
cacheXmlGets or sets if the XML should be cached.
serializerOptionally the serializer used for deserializing the test plan.
Returns
Returns the new test plan.

◆ Load() [3/4]

static TestPlan OpenTap.TestPlan.Load ( string filePath)
static

Load a TestPlan.

Parameters
filePathThe file path of the TestPlan.
Returns
Returns the new test plan.

◆ Load() [4/4]

static TestPlan OpenTap.TestPlan.Load ( string filePath,
bool cacheXml )
inlinestatic

Load a TestPlan.

Parameters
filePathThe file path of the TestPlan.
cacheXmlGets or sets if the XML should be cached.
Returns
Returns the new test plan.

◆ OnPropertyChanged()

virtual void OpenTap.TestPlan.OnPropertyChanged ( string name)
inlineprotectedvirtual

When a property changes this function is called.

Parameters
nameInputs the string for the property changed.

◆ Open() [1/3]

void OpenTap.TestPlan.Open ( IEnumerable< IResource > additionalResources)
inline

Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources.

Parameters
additionalResourcesAdditional resources added as 'static' resources.

◆ Open() [2/3]

void OpenTap.TestPlan.Open ( IEnumerable< IResultListener > listeners)
inline

Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources.

Parameters
listenersResult listeners used in connection with the test plan.

◆ Open() [3/3]

void OpenTap.TestPlan.Open ( IEnumerable< IResultListener > listeners,
IEnumerable< IResource > additionalResources )
inline

Opens all resources referenced in this TestPlan (Instruments/DUTs/ResultListeners). This can be called before TestPlan.Execute() to manually control the opening/closing of the resources. It can also be called multiple times to add more resources.

Parameters
listenersResult listeners used in connection with the test plan.
additionalResourcesAdditional resources added as 'static' resources.

◆ Reload()

TestPlan OpenTap.TestPlan.Reload ( Stream filestream)
inline

Reload a TestPlan transferring the current execution state of the current plan to the new one.

Parameters
filestreamThe filestream from which the plan loaded
Returns
Returns the new test plan.

◆ Save() [1/3]

void OpenTap.TestPlan.Save ( Stream stream)

Saves this TestPlan to a stream;.

Parameters
streamThe Stream in which to save the TestPlan.

◆ Save() [2/3]

void OpenTap.TestPlan.Save ( Stream stream,
TapSerializer serializer )
inline

Saves this TestPlan to a stream with a specific serializer.

Parameters
streamThe Stream in which to save the TestPlan.
serializerOptional. The serializer use for deserialization. If set to null, one will be created.

◆ Save() [3/3]

void OpenTap.TestPlan.Save ( string filePath)
inline

Saves this TestPlan to a file path.

Parameters
filePathThe file path in which to save the TestPlan.

Property Documentation

◆ AllowEditWhilePaused

bool OpenTap.TestPlan.AllowEditWhilePaused
getset

Can be set to true to allow editing the test plan while it's paused.

This is set to non-editorbrowsable to avoid it being modified from a test step.

OpenTAP 9.34 API built Wed Jul 1 2026 09:21:15