---
title: Instrument Your Browser Tests With RUM
description: >-
  Learn how to use CI Visibility and RUM to connect your test results with
  browser sessions and session replays.
breadcrumbs: Docs > Test Optimization in Datadog > Instrument Your Browser Tests With RUM
---

# Instrument Your Browser Tests With RUM

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site). ().
{% /alert %}

{% /callout %}

## Overview{% #overview %}

Test Optimization integrates with Datadog [Real User Monitoring](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/browser/) to provide you with the tools for deep analysis of your browser tests.

### Compatibility{% #compatibility %}

To enable RUM integration ensure that [Test Optimization](https://docs.datadoghq.com/tests/setup/) is set up for your tests and that the application being tested is instrumented using [RUM](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/browser/).

RUM integration is supported for Cypress browser tests and Selenium-driven browser tests.

#### Cypress{% #cypress %}

- `cypress` >= 6.7.0
- `dd-trace-js` >= 1.7.0
- `browser-sdk` >= 3.11.0

#### Selenium{% #selenium %}

- `selenium-js` >= 4.11.0, `dd-trace-js` >= 5.11.0 / >= 4.35.0
- `selenium-java` >= 3.141.59, `dd-trace-java` >= 1.34.0
- `selenium-dotnet` >= 3.0.0, `dd-trace-dotnet` >= 2.51.0
- `selenium-ruby` >= 4.0.0, `datadog-ci` >= 1.0.0.beta6
- `browser-sdk` >= 5.15.0

#### Playwright{% #playwright %}

- `playwright` >= 1.38.0
- `dd-trace-js` >= 5.46.0
- `browser-sdk` >= 5.15.0

{% alert level="info" %}
From Browser SDK v5.0.0, enable the `allowUntrustedEvents` initialization parameter during the tests to correctly capture clicks.
{% /alert %}

## Connect browser tests and RUM{% #connect-browser-tests-and-rum %}

If you use Cypress, Selenium, or Playwright to run your browser tests and the application being tested is instrumented using [Real User Monitoring](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/browser/), your test results and their generated RUM browser sessions and session replays are automatically linked.

A **Browser Sessions** tab appears in the Test Optimization test details side panel.

{% image
   source="https://datadog-docs.imgix.net/images/ci/ci-browser-session-tab.70cb666a790b52ae5ccdd59e58494933.png?auto=format"
   alt="Browser Session Tab in Test Detail" /%}

The RUM session has all the data that [RUM normally collects](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/browser/data_collected/) so you can debug potential issues in your browser tests, such as unexpected errors.

{% image
   source="https://datadog-docs.imgix.net/images/ci/ci-browser-session-tab-errors.8a0cf79b3a13e721ffb83b33d2da69a7.png?auto=format"
   alt="Browser Session Tab Errors in Test Detail" /%}

## Further reading{% #further-reading %}

- [Learn about Test Optimization](https://docs.datadoghq.com/continuous_integration/tests)
- [Learn about RUM Browser Monitoring](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/browser)
