Script mode for HTTP monitor (classic) configuration

In addition to the configuration in the UI (Visual mode), you can use Script mode to configure your HTTP monitors. In this mode, you can access the underlying JSON script of your monitor. If you're a Synthetic Monitoring power user, this will make your life a lot easier and allow you to speed up monitor creation and management. Use the script editor to quickly find specific events (steps) or adapt locators across the entire script.

You aren't limited to just one mode—you can switch between the UI and script modes by selecting the Visual mode/Script mode.

Access the script

To edit your HTTP monitor in script mode:

  1. Go to Synthetic Classic and opt to view your monitors in list mode.
  2. Select the check box next to the monitor that you want to edit > select Edit in the lower-left corner.
  3. Select the HTTP Requests tab of Monitor settings on the left.
  4. Select Script mode at the top.

Edit the script

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:

  • Autocomplete—just press Ctrl+Spacebar to see a list of suggestions.
  • Syntax highlighting makes it easier for you to write script code.
  • Instant error validation—the editor instantly shows a warning for any error in the script. Hover over the error to see what's wrong and a suggestion for how to fix it. You cannot save changes until the code is error free.

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).

Script structure