Returns

Returns a Session object.

Example

# Tries to get a session with custom_id "existing-session-id", creates it if not found.
session = galtea.sessions.get_or_create(
    custom_id="existing-session-id",
    version_id="YOUR_VERSION_ID",
    test_case_id="YOUR_TEST_CASE_ID"
)

Parameters

custom_id
string
required
The Custom ID of the session to fetch or create.
This is useful to associate sessions in the Galtea platform with those in your application.
version_id
string
required
The ID of the version to associate with this session if it needs to be created.
test_case_id
string
The test case ID. Required for non-production sessions.
context
dict
A flexible key-value context.
is_production
boolean
A flag to indicate if the session is from a production environment. Defaults to False.