Types of clickpath steps

  • Latest Dynatrace
  • How-to guide
  • Published Sep 04, 2025

When you record a browser clickpath, your interactions with your web application are captured as a series of steps. There are different step types to simulate interaction and control the clickpath, for instance, navigating to a URL, a click, selecting an option, entering information, or a JavaScript snippet. Besides the type, steps have different properties, like the target (consisting of locators to identify web elements on a page) and the wait strategy.

Step types

For browser clickpaths, the following step types are available:

  • Navigate
  • Click
  • Tap
  • Keystroke
  • Select option
  • JavaScript
  • Cookie

The Navigate step simulates entering a URL in the address bar of a browser and then loading the page.

To create a browser monitor, it's enough to provide a single Navigate step—it will test a single web page against availability and performance. However, if you want the monitor to perform a test scenario that includes a user journey (for example, open the home page in browser apply search criteria perform search select an option from the search results), extend the monitor by adding steps manually or recording a clickpath.

To enhance synthetic monitor security, Dynatrace blocks monitors from sending requests to a local host (for example, localhost or 127.0.0.1).

In recorded clickpaths, the first step is automatically created as a Navigate step. However, when adding steps manually or editing a clickpath, you can add a JavaScript event as the first step of the monitor. Navigate steps can be preceded only by one or more JavaScript steps. A clickpath requires at least one Navigate step.

Going to a new webpage by clicking a link in the current webpage creates a Click step in desktop profiles (or a Tap step on mobile devices), not a Navigate step.

Optional Toggle the Use HTTP authentication switch if the website you want to test requires credentials.

You can choose how you want to store credentials.

  • Credential Vault—a recommended option since it provides more security. Choose HTTP authentication or Kerberos as an authentication method, and then select previously existing credentials or add new ones.

    To add new credentials in Synthetic Synthetic, select Add credential, and to add new credentials in previous Dynatrace, select Credential vault (classic).

  • Monitor script—choose HTTP authentication or Kerberos as an authentication method, and then provide a username and password.

If you choose Kerberos as an authetication method, also provide a realm name and authentication server allow list.

Click

In browser monitors, the Click step defines where to perform a mouse click on a page. It's inserted when you click an element such as a link, button, or field.

The Click step interacts with a specific element on the web page. See the information on locators below to define how an element should be found.

Tap

In mobile device profiles (including tablets, laptops with touch, and custom devices specified as mobile), the Tap step defines where on a page to record tapping the device screen with a fingertip. For example, a Tap is inserted when you tap a hyperlink, button, or select a field.

When recording on mobile device profiles, the cursor changes to an icon that represents a fingertip.

Mobile cursor

The Tap step interacts with a specific element on screen. See the information on locators below to define how an element should be found.

Keystroke

The Keystroke step captures the string you type in a field on a web page.

  • All text is captured as plain text by default. However, for passwords stored in the credential vault, the text type is Credentials.

    Dynatrace stores and manages all Synthetic Monitoring credentials in a credential vault. Credentials are access controlled and can be designated as owner only or public.

    Read on below to learn how to capture or set a password and how to create a token in a Keystroke step.

    Who can edit a monitor that has associated credentials?

    The editing permissions depend on whether a monitor is associated with a public or restricted credential.

    • If a monitor is associated with a public credential, anyone on your team can switch on/off, delete, or edit the monitor.
    • If a browser monitor (clickpath or single URL) is associated with a restricted credential (owner only or shared with a few users), any user can make changes to certain fields, even if they don't have access to the credential used. You can edit monitor name, device emulation settings, wait conditions, frequency, locations, outage alerting, performance thresholds, metrics, connected applications, validation, and HTTP status codes to be ignored. And, of course, you can change a token or user ID/password credential. You can create a credential within monitor settings in edit mode. You'll need to change all credentials in the monitor to ones that you have access to. Note that replacing another user's credential with one you have access to is irreversible.

      Controls that you cannot edit—such as the URL, switching on/off HTTP authentication, adding or deleting clickpath events, data entry in Keystroke, and Advanced setup in monitor settings—are grayed out or display an error message when you attempt to save changes, whether in script or UI mode.

    • You can switch on/off or delete a synthetic monitor that's secured by another user's owner-only credentials.

    Read more about credential permissions in Credential vault for synthetic monitors.

  • Simulate "Return" key automatically simulates the pressing of the Return key after keystrokes, for example, to submit a search string or trigger a login. When creating a monitor in UI mode, this saves you from having to set up a Click step after entering data into a field.

  • Simulate blur events (switched on by default) defines whether a blur step is simulated, which is usually when a text field loses focus.

  • The Keystroke step interacts with a specific element on screen such as a form field. See the information on locators below to define how an element should be found.

Capturing or setting a password in Keystroke

In a Keystroke step, a recorded password is captured by default as plain text, but you can save it as a credential.

  1. Copy the captured password.
  2. Select Type credentials.
  3. Select Add credential.
  4. Choose Username and password from Credential type.
  5. Provide a Credential name.
  6. Specify the Username and paste the copied password to Password.
  7. Select Save to vault.

You can also:

  • Use a previously created credential stored in the vault. Choose it from the Select credential list. You can only see credentials that you have access to in this list, that is, public credentials or owner-access credentials created by you.

  • Add a new credential as a token. To do it, choose Token as a Credential type when you Add credential.

Note that you must have permission to access the credential vault in order to create credentials in a browser monitor this way. You can always capture entered credentials as part of a recorded clickpath.

Create a token in Keystroke

You can use an existing token you have access to in Keystroke. Select Type credentials and choose the name of the credential you want to use (Select credentials).

To create a new token

  1. Select Add credentials.
  2. Select Token as the Credential type.
  3. Edit the default credential name.
  4. Provide a Token value.
  5. Select Save to vault.

The credentials you create this way are automatically set to owner-only permissions and can only be used by you.

Note that you must have permission to access the credential vault in order to create credentials in a browser monitor this way.

Select option

The Select option step describes the use of lists in a clickpath.

The Index describes the position of the chosen item from the top; the first item in a list is always annotated 0. The Value field shows the text value of the item selected.

Select Add selection to add another item to select in the same list. You can delete selected options as required.

The Select option step interacts with a specific element on screen. See the information on locators below to define how an element should be found.

JavaScript

The JavaScript step allows you to execute snippets of JavaScript as part of your browser clickpaths.

With JavaScript steps, you can create clickpaths for scenarios with some dynamic parts where it might be necessary to react on the page, for example:

  • Login flows including random security questions
  • Complex date selectors
  • Pages using A/B testing
  • Signups or product order workflows
  • Custom validations

Executing JavaScript on PDF pages is not supported.

For XML pages, you can activate support by switching to script mode and filling in experimentalProperties in the configuration section as follows. The value of the property enableXmlInjection is a regular expression for the target XML page's URL.

"experimentalProperties": [{
"name": "enableXmlInjection",
"value": ".*.xml$"
}
]

During synthetic monitor executions, the target XML page is rendered in HTML.

In the Code box, define your JavaScript snippet.

When adding steps manually or editing a clickpath, you can add a JavaScript step as the first step of the monitor for such use cases as fetching a credential from the credential vault and setting a variable for use in the Navigate event URL. This feature requires ActiveGate version 1.225+ and Chromium version 88+ on private Synthetic locations.

Navigate steps can be preceded only by one or more JavaScript steps; a clickpath requires at least one Navigate step.

JavaScript step API

The JavaScript event offers a basic API for the following operations.

Store and retrieve values across monitor steps

  • api.setValue(key, value)—Sets a value for the key. Use a separate instance of api.setValue() for each key-value pair you wish to specify.
  • api.getValue(key)—Gets the value of the key previously set by api.setValue().
  • api.getValues()—Returns an object holding the key-value pairs that were previously set by api.setValue().

Variables can be passed only in the context of a single execution of browser clickpath. You also need to make sure that when you refer to a variable, the data behind it is logically available to the monitor.

After you set a global variable using the api.setValue() method, you can subsequently apply its value using the {variable_name} convention with api.getValue() or api.getValues(). You can also apply the value in subsequent browser clickpath configuration fields using the {variable_name} convention.

Variable and key names have a 100-character limit. Global variable values have a 5000-character limit.

Mark steps as failed or finished

  • api.fail(message)—Marks the request as failed, providing the message as the reason, and marks the monitor execution as failed.
  • api.finish()—Finishes the JavaScript step so that the next step is executed.
  • api.startAsyncSyntheticEvent()—Causes the JavaScript step to wait for a later call of api.finish() or api.fail() to end it. As the use of this method overrides the wait condition, we recommend setting the wait time to None.

Skip clickpath steps

These methods skip steps after completion of the current step.

  • api.skipNextSyntheticEvent()—Skips execution of the next step.
  • api.skipNextSyntheticEvents(n)—Skips execution of the next n consecutive steps.
  • api.skipSyntheticEvent(eventIndex)—Skips execution of the step with the index eventIndex. Event index numbers start at 1 and match the step numbers displayed in the web UI.
  • api.skipSyntheticEvents(eventIndexes)—Skips execution of multiple steps; the array eventIndexes specifies the indexes of steps to skip, for example, api.skipSyntheticEvents([8, 9]).

Basic logging

  • api.info(message)—Logs a message using the info log level.
  • api.warn(message)—Logs a message using the warning log level.
  • api.error(message)—Logs a message using the error log level.

Retrieve data

  • api.getCredential(id, type)—Retrieves a credential value, given the credential ID (id) and (type), which can be username, password, or token. Using dynamic identifiers like variables is not supported. The list consists of only those credentials to which you have access.

    Requires ActiveGate version 1.212+ for private Synthetic locations.

    As a security best practice, we recommend that you use only dedicated test credentials for synthetic monitors.

  • api.getContext().location

    • api.getContext().location.name—Returns the name of the private or public location from where the monitor is executed. This is helpful when applying conditional logic such as displaying localized pages or using different login information per location.
    • api.getContext().location.cloudPlatform—Returns the name of the cloud platform on which a public Synthetic location is deployed.

    During local playback, properties of the context are undefined. We recommend setting a default value to cover this scenario.

Examples

Example 1 - Generate and set a dynamic email address for monitoring a sign-up process.
var email = 'synthetic' + Date.now() + '@example.com';
api.setValue('email', email);
document.getElementById('email').value = email;
Example 2 - Get a random first name / last name from an API endpoint and set it during a sign-up process.
api.startAsyncSyntheticEvent();
fetch('https://randomuser.me/api/').then((resp) => resp.json()).then(function(data) {
document.getElementById('firstName').value = data.results[0].name.first;
document.getElementById('lastName').value = data.results[0].name.lastname;
api.finish();
}).catch(function(error) {
api.fail('Fetch request to randomuser.me failed');
});
Example 3 - Use the cloud platform vendor to differentiate between locations with the same name.
if (api.getContext().location.name === "Sydney" &&
api.getContext().location.cloudPlatform === "AWS") {
document.getElementById("linkAustraliaAWS").click();
}
if (api.getContext().location.name === "Sydney" &&
api.getContext().location.cloudPlatform === "Alibaba") {
document.getElementById("linkAustraliaAlibaba").click();
}
Example 4 - Use a different user ID based on the monitor location.

In this example, a user ID is set in the JavaScript step and stored in a global variable for use later within brackets ({}) in a field or by calling api.getValue(). As an alternative to setting a variable for the user ID, you may also insert a credential from the credential vault.

//Default value for the user ID in case a location not defined below is used
var userid_by_loc = "ValueDoesNotExist";
try {
//Get the location name
var loc = api.getContext().location.name;
api.info("Location Name is: " + loc);
//Get the cloud platform the location is hosted in
var platform = api.getContext().location.cloudPlatform;
api.info("Cloud Platform is: " + platform);
//Set the user ID per location
if ((loc.indexOf("Los Angeles") >= 0) && (platform.includes("Google Cloud") >= 0)) {
userid_by_loc = 'LA_User';
} else if ((loc.indexOf("Oregon") >= 0) && (platform.includes("Google Cloud") >= 0)) {
userid_by_loc = 'Oregon_User';
} else if ((loc.indexOf("Chicago") >= 0) && (platform.includes("Azure") >= 0)) {
userid_by_loc = 'Chicago_User';
}
} catch (err) {
api.info("Error message: " + err.description);
}
//Set a global variable to store the user ID that has been set and use later
api.setValue("UserID", userid_by_loc);

Cookies allow you to store browser state information on the client side so that each monitor execution is based on the same state and you can accurately monitor a performance baseline.

You can set cookies in Advanced setup in the monitor settings in the edit mode. These cookies are valid for the entire monitor execution. If you want to set cookies only for a specific portion of your clickpath, use the Cookie event.

Provide a Name and a cookie Value. Every cookie must be unique within the list.

The following symbols are not allowed in the cookie value: ;,\". Provide the Domain of the cookie, and optionally, the Path to the cookie. Save your cookie.

Select Add cookie to define additional cookies.

Edit element locators

This control is available in Click, Tap, Keystroke, and Select option steps.

When one of the above steps in your clickpath targets a specific element on a webpage, you can view and edit the element locators in either DOM or CSS format. Locators help Dynatrace identify the element during playback. We might capture multiple locators to make sure the element is found even if some parts of the page code (such as names or IDs) change. In most cases, we capture CSS locators. Locators are evaluated sequentially; if the first locator isn't found, the second is evaluated, and so on until there's a match.

Select Add locator, then select DOM or CSS, and provide the locator reference. See DOM locator format below for more information on specifying DOM locators.

Also, you can instruct the monitor to look for a specific element in a different tab or frame when performing the step. Select Look for the element in a different tab or frame and specify the tab/frame using the syntax like window[0].frame[3], where window[0] is the first tab opened and window[1] represents the second tab.

It can also be window[N].frames[X], where X is a number of the iframe that is displayed on the page in tab N.

Frames can also be chained, where window[N].frames[X].frames[Y] means that elements with given locators are within frame Y, which is within frame X on tab N.

DOM locator format

Dynatrace version 1.292+

You might prefer to set up advanced, custom DOM locators for your elements. The rules below define the supported format when using JavaScript in DOM locators to access elements on a webpage. These rules are necessitated by the transition of the Dynatrace Synthetic Recorder (a Google Chrome browser extension) to Manifest Version 3 (MV3), which is the latest iteration of the Chrome extension platform.

  • To identify an element, you can do either of the following.

    • Begin the DOM locator with document..

      document.forms[0][1].options[0]
      document.getElementById('adminusername')
      document.querySelector("body > div.vf-body-container > div > div > section > flows").shadowRoot.querySelectorAll("#postalTown")[1]

      For example, document.getElementById('adminusername') is a way to access the element by element ID; getElementById is a method of document.

    • Use a valid JavaScript global variable name at the beginning of your DOM locator to access an element directly by its ID. The variable name should contain a link to the element with the corresponding ID. For example, for the element <div id="EmailAddress"></div>, you can specify the following DOM locator.

      EmailAddress
  • XPath expressions are supported.

    Your DOM locator beginning with document. can contain an XPath expression in the xpathExpression parameter of the evaluate() method. In the example below, the XPath expression is '//form[@id=\\'ctl00\\']/div[4]/div[3]/span'.

    document.evaluate('//form[@id=\\'ctl00\\']/div[4]/div[3]/span', document, null, XPathResult.ANY_TYPE, null).iterateNext()
  • The DOM locator should be a chain (sequence) of method calls, properties, or index signatures, as shown in the examples below.

    document.method().method1()
    document.method().prop['2565']
    document.method( 11 , 'erert','123')
    document.getElementById('deviceList').querySelectorAll('a')[0]
  • Method call arguments can be any of the following; see the examples that follow.

    • Double-quoted or single-quoted strings
    • Numbers
    • null
    • undefined
    • document
    • XPathResult.*
    document.method("str1")
    document.method('str2', null)
    document.method(undefined, document)
    document.method(XPathResult.ANY_TYPE)
  • Javascript computations are not supported inside DOM locators.

    // Not supported
    document.forms[1+2]
  • Javascript global variables are not supported inside DOM locators.

    // Not supported, where someVar is a global variable
    document.querySelector(someVar)
Related tags
Digital Experience