Browser tests are scenarios executed by Datadog on your web applications. They run at configurable periodic intervals from multiple locations around the world, and from multiple devices. These checks verify both that your applications are up and responding to requests, and that any conditions defined in your scenarios are met.
Define the configuration of your browser test.
Starting URL: The URL from which your browser test starts the scenario.
Name: The name of your browser test.
Select your tags: The tags attached to your browser test. Use the
<KEY>:<VALUE> format to filter on a
<VALUE> for a given
<KEY> on the Synthetics page.
Devices: The devices to run your check on. Available devices are
Locations: The Datadog managed locations to run the test from. Many AWS locations from around the world are available. The full list is retrievable through the Datadog API. You can also set up a Private Location to run a Synthetics Browser test on a private URL not accessible from the public internet.
How often should Datadog run the test? Intervals are available between every 15 minutes to once per week. Contact support to enable additional frequencies for your test.
An alert is triggered if any assertion fails for
<INSERT_NUMBER> minutes from any
To configure your notifications:
Use the actions available in the upper left corner to enrich your scenario:
Note: Your last browser test step must be an Assertion, otherwise there is nothing to check.
Once you have finished your Scenario, click on Save and Launch Test.
Assertions allow you to check if an element, a content, or some text is available in the current page. The default timeout for each step is approximately 60 seconds. You can override the timeout for
Assert that an element is present on the page by expanding the step and changing the
Timeout value (in seconds).
|Asserts that an element (such as a specific |
|Select any element and check if it contains a specific value. For instance, you could select a |
|Asserts that some specific text is present on the current page.|
|Asserts that some specific text is NOT present on the current page.|
|This takes the URL of the last page that was interacted with, then asserts whether a specific value (|
Advanced options for assertions allow you to specify an X-path or a CSS class or ID that you want to use to perform the element selection for any HTML element. For example,
.hero-body. Once you define an element, hit Test, and it will highlight the element in the recording on the right.
The navigation action allow you to:
Note: In the “Enter link URL” box, users must prepend URLs with
This browser test step isn’t added through an actual hovering mechanism (otherwise each element you are hovering would be added as a step) but using a dedicated action with a click.
After selecting the Hover action, click on the element you want to choose to create a new step.
To create a variable, first give it a name then define its value from:
div, etc. content by extracting the text of this element.
|Generates a numeric string with n digits.|
|Generates an alphabetic string with n letters.|
|Generates an alphanumeric string with n characters.|
Once created, use your variable to set an input text on a form or search bar. Use the little hand on your variable box to create an input step:
You can also use your variables in some assertions, including:
To use your variables in one of your assertions, hit Use Variable and select the variable you want to use:
By default, Datadog waits for a page to be fully loaded before performing an action or a next step—with a timeout after 60 seconds. In some cases, however, you may wish to set a custom waiting time. For instance, if you know that a page or a page element is taking more than 60 seconds to load, you can leverage the wait step in order to extend that default timeout. If you choose to use this functionality, the value for your wait step must not exceed 300 seconds.
Note: This additional time is systematically added to each run of your browser test scenario.
A test is considered
FAILED if it does not satisfy its assertions or if the request failed for another reason. You can view specific browser test errors by clicking on the error in the step results.
Common failure reasons include:
|The element is on the page but cannot be clicked on—for instance, if another element is overlaid on top of it.|
|The element cannot be found in the HTML.|
|The specified option is missing from the dropdown menu.|
|The test likely encountered a protocol that is not supported. Reach out to Datadog support for further details.|
|A general error message. Contact support for further details.|