Skip to main content

Generate test cases from User Sessions

Last updated: October 2026

User Sessions lets you find captured real-user sessions, review the recorded steps, and generate automated test cases from selected sessions. Use this workflow when you want to convert specific captured behavior into test cases before reviewing a full user journey map.

Requirements
  • To search and review sessions: Configure TrueTest Agent to collect sessions for the application under test (AUT), and link the project to an active AUT with at least one data tracking environment. See Configure TrueTest Agent.
  • To generate test cases: Meet the search requirements above, enable AI features for your organization, ensure you have permission to generate test cases in the project, and configure a script repository or test project for generated TrueTest artifacts.

Search for user sessions​

  1. In your project, navigate to Monitoring > User Sessions.
  2. Select the required filters:
    • Tracking Environment
    • Tracking Period with start date and end date. The end date can be in the future, but the start date cannot. The start must be on or before the end, and the range can cover up to 90 days.
  3. Optionally refine the search with:
    • User session attributes: Enter an attribute query to find sessions with matching metadata. See Set user session attributes for syntax and examples.
    • URL keywords: Enter comma-separated keywords, such as checkout, payment. Keywords are matched as text, not as regular expressions.
    • Steps: Select Greater than, Less than, or Equal to, then enter a step count to find sessions by their number of captured steps.
    • Error types: Find sessions with captured console errors. Choose Any error or a specific error type, and optionally search the error message text.
  4. Click Apply filters.

The results table shows session details such as session ID, tracking environment, start time, last data received, generated test case status, number of steps, and available actions. You can show up to 100 sessions per page.

To clear the selected filters, click Reset.

Review a session before generation​

Before generating a test case, open the session details to confirm that the captured behavior matches the scenario you want to automate.

  1. In the User Sessions table, click a user session ID or the View details button for a session. Both options open the same session detail view.
  2. Review the opened session detail panel.
  3. Review the session source, start and end time, session attributes, test steps, and replay panel when replay data is available.

Reviewing the session helps you avoid generating test cases from incomplete, irrelevant, or duplicate user behavior.

Add verifications before generation​

Before generating from a single User Session, you can add verifications or custom Groovy scripts to eligible captured steps in Session Replay.

  1. Open the User Session detail view.
  2. On an eligible test step, open the action menu and select Add verification or Invoke custom script.
  3. Configure the verification or script. For an element verification, select the target element in Session Replay and complete the verification details.
  4. Save the changes before generation.

The verification types, locator details, custom-script fields, validation rules, and annotation controls follow the existing flow workflow. See Add verification to test steps for the available verification types and configuration details.

If you select Generate while changes are unsaved, choose Discard & generate to discard all pending edits and generate from the last saved version, or Cancel to keep editing. To include your changes, cancel, save them in the editor, then generate.

Discard unsaved changes and generate dialog with Cancel and Discard and generate actions

If the session already has a linked generated test case, eligible controls remain available for adding verifications, deleting steps, and breaking the session. Save the edits, then re-generate the linked test case to apply them.

Generate test cases from sessions​

Optionally, you can click the Generate button to generate test case one by one in the Session Replay page of each session, or generate in bulk from the User Sessions table.

note

The Generate and Generate test cases controls require the generation permissions and project configuration listed above. Existing generation-status restrictions still apply.

  1. In the User Sessions table, select the sessions you want to generate.
  2. Click Generate test cases.
  3. In the generation dialog, optionally add test case tags and choose whether generated names include the TrueTest TC ID prefix.
  4. Confirm generation and wait for TrueTest to finish generating the test case.

When the test case is ready, the session row and detail view show a test case link, such as TC-1. Click the test case link to open the generated test case in the linked project when the link is available.

If generation fails, the User Sessions table and detail view retain the failure status so you can review the error and retry after resolving the cause.

If a linked test case has a red error icon, hover over or focus the icon to read the error code. The detail view shows Generate when no test case is linked and Regenerate when one is linked.

TrueTest generates the test case name and description automatically. The User Sessions UI does not provide fields to edit them before generation.

note

Sessions that already have generated test cases or are currently generating cannot be selected. After you submit a bulk generation request, selected sessions are queued or disabled until their generation status is refreshed.

Re-generate a test case​

When a User Session already has a linked test case, make edits and click Regenerate to update that same test case without creating an unrelated duplicate.

Regenerate a test case in user session

If the session has unsaved changes, choose Discard & regenerate to discard all pending edits and regenerate from the last saved version, or Cancel to keep the draft. To include your changes, cancel, save them in the editor, then regenerate.

For a session without unsaved changes, confirm Overwrite and regenerate. TrueTest keeps the existing test case link while re-generation is running and if re-generation reports an error.

Re-generation is unavailable while the session, test case, or Journey Map is already queued or generating.

How User Sessions generation works with journey maps​

If a selected session is already represented by an active flow in the latest completed Journey Map, TrueTest can reuse that flow instead of creating a duplicate representation of the captured behavior.

Use Journey Maps for coverage analysis and flow review. Use User Sessions when you want to quickly automate specific captured sessions.

Generated artifacts​

Generated artifacts are stored in the project repository configured for the AUT. This repository is a project-level configuration, not something chosen from the User Sessions filter values.

When a tracking environment name is available, TrueTest writes generated artifacts under an AI-Generated/<tracking-environment-name> folder in the Katalon project repository, including:

  • Test Cases/AI-Generated/<tracking-environment-name>
  • Scripts/AI-Generated/<tracking-environment-name>
  • Object Repository/AI-Generated/<tracking-environment-name>
  • Data Files/AI-Generated/<tracking-environment-name>
  • Test Data Driven/AI-Generated/<tracking-environment-name>

TrueTest also updates required generated support keywords under the Keywords/truetest package.

New generation runs no longer copy Test Step JSON exports or steps_overview.csv into the customer project. Existing copies are left unchanged. TrueTest continues to create these artifacts internally for processing.

To keep generated artifacts organized, use naming conventions, tags, and project-level organization where available. Avoid manually moving generated TrueTest files out of the generated folders unless your team has confirmed the move is supported by your current TrueTest and repository workflow.

Limitations​

  • Required filters: You must select a tracking environment, start date, and end date before searching.
  • Date range rules: The start date must be on or before the end date. The end date must be today or earlier. The selected range must be 90 days or less.
  • Search behavior: Session search runs asynchronously. If a search fails, adjust the filters and try again, or contact Katalon Support if the failure continues.
  • Generated metadata: In this workflow, TrueTest submits generated test cases with automatically assigned name and description values.
Was this page helpful?