In addition to the usual configuration in the UI, you can use Script mode to configure your clickpath or single-URL monitors. In this mode, you can access the underlying JSON script of your monitor. If you're a synthetic power user, this will make your life a lot easier and allow you to speed up clickpath creation and management. Use the script editor to quickly find specific events (steps), adapt locators across the whole script, or edit parts of the clickpath without rerecording.
You aren't limited to just one mode—you can switch back and forth between the UI and script modes by clicking the Clickpath/Script switch.
To edit your clickpath browser monitor in script mode:
To edit your single-URL browser monitor in the script mode:
You can download the script (Download script as .json) or just copy it from the editor and edit it in a text editor of your choice. However, you can also edit the script directly in the browser. This provides the following benefits:
Note that you need to escape all special characters and break lines with a backslash (for example, a new line is \n, double quotes is \", and tab is \t).
You can play your changes back for clickpath scripts without saving them—just click Play back clickpath.
Contains the monitor script.
| Element | Type | Description | Required |
|---|---|---|---|
configuration | The setup of the monitor | Optional | |
type | string | The type of monitor Possible values are:
| Required |
version | string | Script version—use the | Required |
events | Array of: navigateEvent | Steps of the clickpath—the first step must always be of the Note that an event is not the same thing as an action—only events that trigger web requests are called actions, so your script might not have as many actions as events. Synthetic actions (similar to user actions for real user monitoring) hold the performance data collected during the playback of clickpath events. The actual JSON object of the event depends on its type:
| Required |
ScriptConfig object Contains the setup of the monitor.
| Element | Type | Description | Required |
|---|---|---|---|
userAgent | string | The user agent of the request | Optional |
device | The emulated device of the monitor—holds either the parameters of the custom device or the name and orientation of the preconfigured device. If not set, then the | Optional | |
bandwidth | The emulated network conditions of the monitor If not set, then the full available bandwidth is used. | Optional | |
requestHeaders | The list of HTTP headers to be sent with requests of the monitor | Optional | |
cookies | List of cookies to be created for the monitor These cookies are added before execution of the first step. | Optional |
customDevice object Contains the emulated device of the monitor.
| Element | Type | Description | Required |
|---|---|---|---|
mobile | boolean | The flag of the mobile device Set to | Required |
touchEnabled | boolean | The flag of the touchscreen Set to | Required |
width | integer | The width of the screen in pixels The maximum allowed width is | Required |
height | integer | The height of the screen in pixels The maximum allowed height is | Required |
scaleFactor | integer | The pixel ratio of the device | Optional |
predefinedDevice object Contains one of the preconfigured device emulations.
| Element | Type | Description | Required |
|---|---|---|---|
deviceName | string | The name of the preconfigured device—when editing in the browser, press | Required |
orientation | string | The orientation of the device— Desktop and laptop devices are not allowed to use the | Required |
bandwidthOptions object Contains the emulated network conditions of the monitor.
| Element | Type | Description | Required |
|---|---|---|---|
latency | integer | The latency of the network, in milliseconds | Required |
download | integer | The download speed of the network, in bytes per second | Required |
upload | integer | The upload speed of the network, in bytes per second | Required |
predefinedBandwidth object Contains the pre-configured network emulations.
| Element | Type | Description | Required |
|---|---|---|---|
networkType | string | The type of the preconfigured network—when editing in the browser, press | Required |
requestHeader object Contains the list of HTTP headers to be sent with requests of the monitor.
The following headers are not allowed:
| Element | Type | Description | Required |
|---|---|---|---|
name | string | The name of the HTTP header | Required |
value | string | The value of the HTTP header | Required |
requestCookie object Contains the list of cookies to be created for the monitor.
Every cookie must be unique within the list. However, you can use the same cookie again in other event.
| Element | Type | Description | Required |
|---|---|---|---|
name | string | The name of the cookie The following cookie names are not allowed:
| Required |
value | string | The value of the cookie—the following symbols are not allowed: | Required |
domain | string | The domain of the cookie | Required |
path | string | The path to the cookie | Optional |
navigateEvent object Contains a Navigate event.
| Element | Type | Description | Required |
|---|---|---|---|
type | string | The type of synthetic event In this case, the event type is | Required |
url | string | The URL to navigate to | Required |
description | string | A short description of the event to appear in the UI | Required |
wait | The wait condition for the event—defines how long Dynatrace should wait before the next action is executed. | Optional | |
validate | The validation rule for the event—helps you verify that your browser monitor loads the expected page content or page element. | Optional | |
target | The tab on which the page should open | Optional | |
authentication | The login credentials to bypass the browser login mask | Optional |
interactionEvent object Contains a Click or a Tap event.
| Element | Type | Description | Required |
|---|---|---|---|
type | string | The type of synthetic event In this case, | Required |
description | string | A short description of the event to appear in the UI | Required |
button | integer | The mouse button to be used for the click | Required |
wait | The wait condition for the event—defines how long Dynatrace should wait before the next action is executed. | Optional | |
validate | The validation rule for the event—helps you verify that your browser monitor loads the expected page content or page element. | Optional | |
target | The element to click/tap on | Optional |
javaScriptEvent object Contains a JavaScript event.
| Element | Type | Description | Required |
|---|---|---|---|
type | string | The type of synthetic event In this case, | Required |
description | string | A short description of the event to appear in the UI | Required |
javaScript | string | The JavaScript code to be executed in this event | Required |
wait | The wait condition for the event—defines how long Dynatrace should wait before the next action is executed. | Optional | |
target | The tab where the JavaScript code is executed | Optional |
selectOptionEvent object Contains a Select option event.
| Element | Type | Description | Required |
|---|---|---|---|
type | string | The type of synthetic event In this case, | Required |
description | string | A short description of the event to appear in the UI | Required |
selections | The options to be selected | Required | |
wait | The wait condition for the event—defines how long Dynatrace should wait before the next action is executed. | Optional | |
validate | The validation rule for the event—helps you to verify that your browser monitor loads the expected page content or page element. | Optional | |
target | The selection tag of the dropdown list | Optional |
cookieEvent object Contains a Cookie event.
| Element | Type | Description | Required |
|---|---|---|---|
type | string |
| Required |
description | string | A short description of the event to appear in the UI | Required |
cookies | The list of cookies to be created during the event Every cookie must be unique within the list. However, you can use the same cookie again in other event. | Required |
keystrokesEvent object Contains a Keystroke event.
| Element | Type | Description | Required |
|---|---|---|---|
type | string |
| Required |
description | string | A short description of the event to appear in the UI | Required |
textValue | string | The text to enter | Required |
masked | boolean | Indicates whether the textValue is encrypted ( | Required |
simulateBlurEvent | boolean | Defines whether to blur the text field when it loses focus. Set to | Required |
wait | The wait condition for the event—defines how long Dynatrace should wait before the next action is executed. | Optional | |
validate | The validation rule for the event—helps you to verify that your browser monitor loads the expected page content or page element. | Optional | |
target | The object to enter the text to | Optional |
waitCondition object Contains the wait condition for an event.
| Element | Type | Description | Required |
|---|---|---|---|
waitFor | string | The time to wait before the next event is triggered Possible values are:
| Required |
milliseconds | integer | The time to wait, in milliseconds The maximum allowed value is | Required for the Not applicable otherwise |
timeoutInMilliseconds | integer | The maximum amount of time to wait for a certain element to appear, in milliseconds—if exceeded, the action is marked as failed. The maximum allowed value is | Required for the Not applicable otherwise |
validation | The element to wait for | Required for the Not applicable otherwise |
validationType object Contains the validation rule for an event or waiting rule.
| Element | Type | Description | Required |
|---|---|---|---|
type | string | The goal of the validation:
| Required |
match | string | The content to look for on the page Regular expressions are allowed. In that case set isRegex as | Required for Optional for |
isRegex | boolean | Defines whether match is a plain text ( | Optional |
failIfFound | boolean | The condition of the validation:
| Required |
target | The element to look for on the page | Required for Optional for |
plainAuthenticationType object Plain login credentials to bypass the browser login mask during a Navigate event
| Element | Type | Description | Required |
|---|---|---|---|
type | string | The type of authentication—
| Optional |
username | string | The username to log in with. | Required |
password | string | The password to log in with. It contains not the actual password, but a unique ID of it, and the password itself is stored in Dynatrace and found by the ID. If you change the ID, the stored password becomes unavailable. To change the password, set the masked property as | Required |
masked | boolean | The flag of the masked password
Set | Optional |
secureAuthenticationType object The login credentials to bypass the browser login mask during a Navigate event.
| Element | Type | Description | Required |
|---|---|---|---|
type | string | The type of authentication—
| Optional |
credential | The credential object that contains the username and password. | Required | |
domain | string | Kerberos domain. | Required for |
authServerAllowlist | string | List of allowed servers for kerberos authentication. Wildcards can be used. Exact details are provided in the Chrome Enterprise documentation. | Required for |
credentialType object The credentials from the credential vault.
| Element | Type | Description | Required |
|---|---|---|---|
id | string | The ID of the credentials in the credential vault. | Required |
credentialField | string | The type of authentication— | Optional |
listOptions object Contains the options to be selected in the Select option event.
| Element | Type | Description | Required |
|---|---|---|---|
index | integer | The index of the option to be selected | Required |
value | string | The value of the option to be selected | Required |
targetType object Contains the target tab or element of the event.
| Element | Type | Description | Required |
|---|---|---|---|
window | string | The tab of the target | Optional |
locators | The list of locators identifying the desired element | Optional |
locatorType object Contains an element of a page to look for.
| Element | Type | Description | Required |
|---|---|---|---|
type | string | Defines where to look for the element:
| Required |
value | string | The name of the element to be found | Required |
Synthetic Classic