7.3Create a browser monitor
In the dashboard#
- Select + new monitor in the top navigation.
- Choose the browser tab.
- In name, enter a name you will recognise in an alert, for example
Login works. - Set check interval. It starts at 60 seconds. Your plan's minimum still applies.
- Set timeout. This is the time the whole check may take. It starts at 10 seconds. Raise it for scripts with several steps (see 7.7).
- Choose the regions and the alert channels.
- In start url, enter the page where the task begins, for example
https://app.example.com/login. - Under steps, build your script (see 7.4). The form already has one empty
gotostep. Select + add step to add a row. A new row starts asclick. Use the remove button on a row to delete it. - Select create monitor →.
To check the page without a script, remove all the steps before you save.
If the browser tab shows a meter such as <used> of <limit> browser monitors used, your plan limits how many browser monitors you can have (see 7.12).
If the form shows an error#
The form numbers steps from 1, the same as the rows you see.
| Message | What to do |
|---|---|
A URL is required | Enter a start URL. |
Enter a full http:// or https:// URL | Enter the whole address, including https://. |
Must be an http:// or https:// URL | Use an http:// or https:// address. |
step 2: url required | Enter a URL in that goto step. |
step 3: selector required | Enter a selector in that step (see 7.5). |
step 4: expected text required | Enter the text that assert_text should find. |
Your plan checks at most every 300 seconds | Enter a longer check interval. |
This monitor is paused — resume it to run a check | Resume the monitor, then select run once now again. |
check just ran — try again in <N>s | Wait for the time shown, then try again. |
Through the API#
Send a POST to CreateBrowserMonitor. A full example is in 7.6. These are the fields:
| Field | What to enter |
|---|---|
name | The monitor's name. |
startUrl | Required. An http:// or https:// address. |
scriptJson | The script, written as a JSON string, not as an array. Leave it out to check the page without a script. |
intervalSeconds | How often to check. Your plan's minimum still applies. |
timeoutMs | The time the whole check may take, in milliseconds (see 7.7). |
locations | The regions to check from (see 3.2). |
alertChannelIds | The alert channels to notify (see chapter 10). |
assertions | Optional page checks. API only (see 7.4). |
The answer is {"monitor": {...}}. In the saved monitor, the start URL and script are called browserStartUrl and browserScriptJson.
To change the script later, call UpdateMonitor with config. This replaces the whole setup, so send every field again. To run a check now through the API, use TriggerNow (see 3.6).
When you save through the API, obsrvly checks only the outline of the script. It refuses these:
start_url required, orstart_url must be an http or https URL.script_json must be a JSON array of steps.script_json: step 0 is not an object.script_json: step 0: kind must be one of goto, click, fill, wait_for, assert_visible, assert_text.- A script larger than 256 KiB, or a monitor larger than 900 KiB in total.
Other mistakes, such as a missing selector, show up when the check runs (see 7.4).