Browser tests are scenarios executed by Datadog on your web applications. They run at configurable periodic intervals from multiple locations around the world, from multiple browsers, and devices. These tests verify both that your applications are up and responding to requests, and that any conditions defined in your scenarios are met.
If you are interested in testing applications that sit behind MFA, read the dedicated guide and send feedback to the Synthetic Monitoring team to help improve the systems that matter most to your teams.
Define the configuration of your browser test.
Starting URL: The URL from which your browser test starts the scenario.
Advanced Options (optional): Set specific options for your browser test.
Select Disable CORS to prevent the cross-origin resource sharing (CORS) policy from blocking your test.
Request Headers: Define headers in the Name and Value fields to add to or override the default browser headers. For example, you can set the User Agent in the header to identify Datadog scripts.
Cookies: Define cookies to add to the default browser cookies. Enter one cookie per line, using the syntax of Set-Cookie.
HTTP Authentication: Authenticate through HTTP Basic, Digest, or NTLM with a username and a password. Your credentials are used in every step of your browser test.
Request options are set at every test execution and apply to every step of your browser test at execution time, not recording time.
If you need these options to remain active to record the following steps, manually apply the options on the page you are recording from and create subsequent steps in your test.
Select Ignore server certificate error to instruct the test to skip errors in the server certificate.
Client Certificate: Perform tests on systems that require client certificates by clicking Upload File and uploading your certificate file and private key. Only PEM certificates are accepted.
Client Certificate Domains: Once the certificate files are uploaded, the client certificate applies to the starting URL’s domain. To apply the client certificate on another domain, specify the domain in the Value field.
You can include wildcards in the URL.
Enter a URL for a proxy you want to send requests through in the Proxy URL field as http://<YOUR_USER>:<YOUR_PWD>@<YOUR_IP>:<YOUR_PORT>.
Select Do not capture any screenshots for this test to prevent screenshots from being taken in your test steps.
This privacy option is available as an advanced option at the individual test step level and ensures that no sensitive data appears in your test results.
Preventing the test from taking screenshots makes troubleshooting failures more difficult. For more information, see Security.
Name: The name of your browser test.
Select tags: The env and related tags attached to your browser test. Use the <KEY>:<VALUE> format to filter on a <VALUE> for a given <KEY>.
Browsers & Devices: The browsers (such as Chrome, Firefox, Edge, and Internet Explorer 11), and devices (such as Laptop Large, Tablet, and Mobile Small) to run your test on.
For a large laptop device, the dimensions are 1440 pixels x 1100 pixels.
For a tablet device, the dimensions are 768 pixels x 1020 pixels.
For a small mobile device, the dimensions are 320 pixels x 550 pixels.
Select locations: The Datadog managed locations to run your test from. Many AWS locations from around the world are available for each site. You can also set up private locations to run your browser test from custom locations or from inside private networks. See a full list of locations in the Datadog app or use the API.
Note: The West US (AWS GovCloud) location is supported on the Datadog for Government site.
Select test frequency: The intervals vary from every five minutes to once per week. Contact Support for one-minute frequency.
To use global variables in your browser test’s recording, navigate to your recorded steps and click + Variables below the Start Recording button. Select Global Variable from the dropdown menu.
Search for available global variables and click + to add them to your recording panel. When you are done adding global variables, click OK.
Define alert conditions
You can customize alert conditions to define the circumstances under which you want a test to send a notification alert.
An alert is triggered if any assertion fails for X minutes from any n of N locations. This alerting rule allows you to specify for how much time and on how many locations a test needs to fail before triggering the notification.
Retry X times before location is marked as failed. This allows you to define how many consecutive test failures need to happen for a location to be considered as failed. By default, there is a 300ms wait before retrying a test that failed. This interval can be configured with the API.
Notify your team
A notification is sent according to the set of alerting conditions. To configure your notifications:
You can switch tabs in a browser test recording in order to perform an action on your application (such as clicking on a link that opens another tab) and add another test step. Your browser test must interact with the page first (through a click) before it can perform an assertion. By recording all of the test steps, the browser test can switch tabs automatically at test execution.
Optionally, select Open in a pop-up at the upper right of the page to open your test recording in a separate pop-up window. This is useful if your application does not support being opened in an iframe or if you want to avoid sizing issues at recording. You can also open the pop-up in Incognito mode to start recording your test from a fresh browser free from already logged-in sessions, cookies from your existing browser, and more.
Optionally, enable Datadog to automatically collect RUM data when running step recordings from your browser test. For more information, see Explore RUM & Session Replay.
Click Start Recording to begin recording your browser test.
As you click on your application going through the user journey you want to monitor, your actions are automatically recorded and used to create steps within your browser test scenario on the left.
In addition to the automatically recorded steps, you can also use the steps available in the upper left corner to enrich your scenario:
Note: You should always make sure to end your browser test with an assertion to confirm the journey executed by the browser test resulted in the expected state.
Once you have finished your scenario, click Save and Launch Test.