OpenTAP 9.34
API Reference
OpenTap.Session Class Reference

A session represents a collection of data associated with running and configuring test plans: More...

Public Member Functions

void Dispose ()
 Disposes the session.
 
void RunInSession (Action action)
 Synchronously runs the specified action in the context of the given session.
 

Static Public Member Functions

static Session Create (SessionOptions options=SessionOptions.OverlayComponentSettings|SessionOptions.RedirectLogging, Guid? id=null)
 Creates a new session in the current TapThread context. The session lasts until the TapTread ends, or Dispose is called on the returned Session object.
 
static Session Create (SessionOptions options)
 Creates a new session in the current TapThread context. The session lasts until the TapTread ends, or Dispose is called on the returned Session object.
 
static void Start (Action action, SessionOptions options=SessionOptions.OverlayComponentSettings|SessionOptions.RedirectLogging)
 Creates a new session, and runs the specified action in the context of that session. When the acion completes, the session is Disposed automatically.
 

Public Attributes

readonly Session Parent
 The parent session of the current session. This marks the session that started it.
 

Static Public Attributes

static readonly Session RootSession
 The default/root session. This session is active when no other session is.
 

Properties

static Session Current [get]
 Gets the currently active session.
 
Guid Id [get]
 Gets the session ID for this session.
 
SessionOptions Options [get]
 Gets the flags used to create/start this session.
 

Detailed Description

A session represents a collection of data associated with running and configuring test plans:

  • Logging
  • Settings
  • Resources
  • ... When a new session is created, it overrides the existing values for these items.

Member Function Documentation

◆ Create() [1/2]

static Session OpenTap.Session.Create ( SessionOptions options)
static

Creates a new session in the current TapThread context. The session lasts until the TapTread ends, or Dispose is called on the returned Session object.

Parameters
optionsFlags selected from the SessionOptions enum to customize the behavior of the session.
Returns
A disposable Session object.

◆ Create() [2/2]

static Session OpenTap.Session.Create ( SessionOptions options = SessionOptions::OverlayComponentSettings | SessionOptions::RedirectLogging,
Guid? id = null )
inlinestatic

Creates a new session in the current TapThread context. The session lasts until the TapTread ends, or Dispose is called on the returned Session object.

Parameters
optionsFlags selected from the SessionOptions enum to customize the behavior of the session.
idOption to specify the ID of the Session
Returns
A disposable Session object.

◆ RunInSession()

void OpenTap.Session.RunInSession ( Action action)
inline

Synchronously runs the specified action in the context of the given session.

Parameters
actionThe action to run.
Returns
The session in which the action is run

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