Mobile Application Testing allows you to test and monitor key business flows for Android and iOS applications using real devices.
Datadog runs these tests on real devices to provide a realistic, step-by-step representation of key application workflows, screenshots of each step, and detailed pass or fail results so your team can quickly visualize what went wrong.
Mobile app tests can run on a schedule, on demand, or directly within your CI/CD pipelines.
You can create mobile app tests in Datadog by navigating to Digital Experience > New Test and selecting Mobile Application Test.
You may create a test using one of the following options:
Create a test from a template:
Hover over one of the pre-populated templates and click View Template. This opens a side panel displaying pre-populated configuration information, including: Test Details, Request Details, Alert Conditions, and Steps.
Click +Create Test to open the configuration page, where you can review and edit the pre-populated configuration options. The fields presented are identical to those available when creating a test from scratch.
Click Save & Quit in the upper right hand corner to submit your Mobile Application Test.
When configuring a new Mobile Application test, use snippets to automatically populate your OS versions, device sizes, manufacturers, and uptime, instead of manually selecting these options. The following snippets are available:
Device Size: Automatically perform your Mobile Application tests on a specifically sized screen across devices:
Multi-screen size
Tablet
Large Screen (iOS only)
Standard Screen (iOS only)
Small Screen (iOS only)
OS Version: Automatically test your iOS or Android apps on multiple versions. This selection toggles to either iOS or Android depending on the choice of your Mobile Application.
Device Manufacturer (Android only): Automatically test your Android apps across multiple device manufacturers.
Uptime: Automatically configure a test with the shortest frequency available (every 15 minutes).
To create a local variable, click Create a Local Variable. You can select one of the following available builtins to add to your variable string:
{{ numeric(n) }}
Generates a numeric string with n digits.
{{ alphabetic(n) }}
Generates an alphabetic string with n letters.
{{ alphanumeric(n) }}
Generates an alphanumeric string with n characters.
{{ date(n unit, format) }}
Generates a date in one of Datadog’s accepted formats with a value corresponding to the UTC date the test is initiated at + or - n units.
{{ timestamp(n, unit) }}
Generates a timestamp in one of Datadog’s accepted units with a value corresponding to the UTC timestamp the test is initiated at +/- n units.
{{ uuid }}
Generates a version 4 universally unique identifier (UUID).
{{ public-id }}
Injects the Public ID of your test.
{{ result-id }}
Injects the Result ID of your test run.
To obfuscate local variable values in test results, select Hide and obfuscate variable value. Once you have defined the variable string, click Add Variable.
You can use the global variables defined in Settings in the Starting URL and Advanced Options of your mobile app test details, as well as in your test recording to define local variables. To display a list of available variables, type {{ in the desired field.
Define the variables you want to incorporate into the user journey before you start recording.
You can inject the variables available to you while recording. For more information about using variables in your mobile test recording, see Mobile App Test Steps.
By default, mobile app tests are set up for on-demand testing, meaning these tests can run directly in a CI pipeline.
You can customize alert conditions to define how often you want to send an alert and the circumstances under which you want a test to send a notification alert.
An alert is triggered if any assertion fails for X minutes.
Show when the monitor matches priority (P1 to P5).
{{^is_priority}}
Show unless the monitor matches priority (P1 to P5).
Notification messages include the message defined in this section and information about the failing locations.
Choose team members and services to notify.
Specify a renotification frequency. To prevent renotification on failing tests, leave the option as Never renotify if the monitor has not been resolved.
Click Save & Edit Recording to save your test configuration and record your mobile app test steps.
Flakiness is a pain point in end-to-end testing. Test failures are occasionally caused by valid frontend code changes that impact an identifier, not by an actual application issue.
To prevent flaky tests, Datadog uses an algorithm that leverages a set of locators to target elements in mobile app tests. A small change in the UI may modify an element (for example, moving it to another location). The mobile app test automatically locates the element again based on points of reference that are not affected by the change.
When the test runs successfully, the mobile app test recomputes (or “self heals”) any broken locators with updated values. This ensures your tests do not break from simple UI updates and your tests are automatically adapting to your mobile application’s UI.
You can run mobile app tests in a CI pipeline by defining the mobileApplicationVersionFilePath option in a test synthetics.json file and a global configuration synthetics-ci.config file as needed. Global configuration file options take precedence over test configuration file options.
In this example, the test aaa-aaa-aaa runs with the override application version found in application/path.
By default, only users with the Datadog Admin and Datadog Standard roles can create, edit, and delete Synthetic mobile app tests. To get create, edit, and delete access to Synthetic mobile app tests, upgrade your user to one of those two default roles.
If you are using the custom role feature, add your user to any custom role that includes synthetics_read and synthetics_write permissions.