Manages test session state and provides session-level operations. Inspired by Appium's session management.
public class DriverSession : IDisposable
// Create a session with capabilities
var session = new DriverSession(driver, new SessionCapabilities
{
ImplicitWait = TimeSpan.FromSeconds(5),
PageLoadTimeout = TimeSpan.FromSeconds(30)
});
// Store session data
session.SetData("user", "testuser");
var user = session.GetData<string>("user");
// Reset session
session.Reset();
kind:method, kind:property, kind:ctor. Press Esc to clear.DriverSession(AvaloniaDriver, SessionCapabilities?)Creates a new driver session.CapabilitiesGets the session capabilities.DataKeysGets all session data keys.DriverGets the associated driver.DurationGets the session duration.SessionIdGets the session ID.StartTimeGets the session start time.ClearData()Clears all session data.Dispose()Disposes the session.GetData<T>(String, T)Gets data from the session with a default value.GetData<T>(String)Gets data from the session.GetSessionInfo()Gets session information as a dictionary.HasData(String)Checks if the session has specific data.RegisterCleanup(Action)Registers a cleanup action to run on session end.RemoveData(String)Removes data from the session.Reset()Resets the session to initial state.RunCleanup()Runs all registered cleanup actions.SetData(String, Object)Stores data in the session.