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- Navigate to the Sessions view in the dashboard
- Select any recorded session to open the Session Replay view
- Click on the Activity tab to view the event timeline
- Look for the Copy Events icon next to the search bar
- Click the icon to open the export options dropdown

Using Convert Session Events to E2E Test
Section titled Using Convert Session Events to E2E TestBasic Usage
Section titled Basic Usage- Click the Copy Events icon in the Activity view
- From the dropdown, select your desired testing framework (Cypress, Playwright, or Puppeteer)
- Choose between Events Only or Complete Test
- Apply “Select events on the timeline” to select which events to include
- Click Copy to copy the generated code to your clipboard
- Paste directly into your test file
Export Options
Section titled Export OptionsTesting Frameworks
Section titled Testing FrameworksThe 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

Export Types
Section titled Export TypesYou 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
Event Selection
Section titled Event SelectionThe 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
Example Output
Section titled Example OutputCypress Example
Section titled Cypress ExampleEvents 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()
})
})
Have questions?
Section titled Have questions?If you have any issues creating E2E tests from your sessions, please contact us on our Slack community and ask our devs directly!