Convert Session Events to E2E Test

The Convert Session Events to E2E Test feature lets you transform recorded user sessions into automated end-to-end test code. This powerful capability bridges the gap between real user behavior and test automation, allowing you to quickly replicate user journeys in your testing framework of choice.

How it works: convert sessions into E2E test code

Section titled How it works: convert sessions into E2E test code
  1. Navigate to the Sessions view in the dashboard
  2. Select any recorded session to open the Session Replay view
  3. Click on the Activity tab to view the event timeline
  4. Look for the Copy Events icon next to the search bar
  5. Click the icon to open the export options dropdown
Convert Session Events to E2E Test

Using Convert Session Events to E2E Test

Section titled Using Convert Session Events to E2E Test
  1. Click the Copy Events icon in the Activity view
  2. From the dropdown, select your desired testing framework (Cypress, Playwright, or Puppeteer)
  3. Choose between Events Only or Complete Test
  4. Apply “Select events on the timeline” to select which events to include
  5. Click Copy to copy the generated code to your clipboard
  6. Paste directly into your test file

The feature supports exporting to three popular testing frameworks:

  • Cypress - Web testing framework focused on developer experience and reliability
  • Playwright - Modern testing library with cross-browser support
  • Puppeteer - Headless browser automation library
Testing Frameworks

You can choose between two export types:

  • Events Only - Generates only the action commands without any test structure
  • Complete Test - Creates a fully structured test with appropriate boilerplate

The timeline selection tool allows you to:

  • Select a specific range of events to include in your export
  • Drag handles to adjust the start and end points

Events Only:

cy.visit('/en/deployment/')
cy.get('a:nth-of-type(9)').click()
cy.visit('/en/deployment/deploy-docker/')
cy.get('.active li:nth-of-type(13) > a').click()
cy.visit('/en/deployment/upgrade/')
cy.get('.active > .justify-between').click()
cy.get('.left-nav-parent > li:nth-of-type(4) > .flex').click()
cy.get('.active li:nth-of-type(5) > a').click()
cy.visit('/en/using-or/next/')
cy.get('.left-nav-parent > li:nth-of-type(5) > .flex').click()
cy.get('.left-nav-parent > li:nth-of-type(6) > .flex').click()
cy.visit('/en/installation/')
cy.get('.active li:nth-of-type(2) > a').click()
cy.visit('/en/installation/identify-user/')
cy.get('li:nth-of-type(7) > .flex').click()
cy.get('.logo-clickarea').click()

Complete Test:

// cypress/e2e/session_replay_test.cy.js

describe('Deployment - OpenReplay Documentation', () => {
  it('Navigates through /en/deployment/', () => {
    cy.visit('/en/deployment/')
    cy.get('a:nth-of-type(9)').click()
    cy.visit('/en/deployment/deploy-docker/')
    cy.get('.active li:nth-of-type(13) > a').click()
    cy.visit('/en/deployment/upgrade/')
    cy.get('.active > .justify-between').click()
    cy.get('.left-nav-parent > li:nth-of-type(4) > .flex').click()
    cy.get('.active li:nth-of-type(5) > a').click()
    cy.visit('/en/using-or/next/')
    cy.get('.left-nav-parent > li:nth-of-type(5) > .flex').click()
    cy.get('.left-nav-parent > li:nth-of-type(6) > .flex').click()
    cy.visit('/en/installation/')
    cy.get('.active li:nth-of-type(2) > a').click()
    cy.visit('/en/installation/identify-user/')
    cy.get('li:nth-of-type(7) > .flex').click()
    cy.get('.logo-clickarea').click()
  })
})

If you have any issues creating E2E tests from your sessions, please contact us on our Slack community and ask our devs directly!