Transaction Check Commands and Validators

This article walks through the various command and validation steps for the Uptime.com Transaction check. It assumes you are creating your first check, or are adding/testing new steps for an existing check.

For setup instructions, see this article. For tips to improve your Transaction check, see this article.

Table of Contents

Commands

Validations

Commands

Authentication & Settings

Sets HTTP basic auth and other settings including HTTP Headers, Browser Viewport Size, and whether to run the check as Mobile. This step always defaults to step 1 when it is utilized. The parameters in this command are below:

Auth and Settings Commands

Basic Auth: Allows you to provide credentials for pages behind Basic HTTP Authentication. You will need a username and password. We highly recommend that you create unprivileged test credentials for any checks that utilize HTTP basic auth.

HTTP Headers: Defines HTTP Headers to be sent with a request. User-Agent is disabled. HTTP Headers must be separated by line break in the Name: value format. 

Screen Size: Defines the viewport size the check will run, or the device the check emulates. The default is 1024x768. 

Mobile: Adds a Mobile flag into the request User-Agent string. When this option is used, the browser also takes into account a page’s `meta viewport` tag and provides touch events support. 

Go To URL

Navigates the browser to the URL that you specify. Note that the target page must load within 30 seconds otherwise the transaction will fail with a page load timeout. Navigation is considered finished when the load event is fired.

Note: Uptime.com adds 1.2 seconds upon navigation to allow for javascript and important assets to load. 

Click Element

Clicks on the specified HTML element. Use the id, name or CSS selector of the element you wish to interact with. Users can define Left, Middle, or Right click, with options to Single, Double, or Triple click. 

Hover Element

Performs a mouse hover over the specified element. Use this command for elements that utilize the :hover selector. 

Focus Element

Focuses on the specified HTML Element. Use this Command for elements that utilize the :focus selector. 

Fill in Element with Text

Fill in a form's text, password, hidden, select, or textarea field with the given text or value.

Check/Uncheck Checkbox/Radio Button

Checks or does not check a specified checkbox or radio button. Use the id, name or CSS selector of the element you wish to interact with. 

Submit Form Element

Submit the specified form (can also be done by button click)

Wait for Element To Exist

Waits until the specified HTML element exists on the page. Use the id, name or CSS selector of the element you are waiting for. Please note that the element must appear within 25 seconds otherwise the transaction will fail with a wait timeout.

Wait for Element To Contain Text

Waits until the specified HTML element appears and then waits for the element to contain the given text. Use the id, name or CSS selector to specify the element, then define the text it should contain. Users can tick a box to enable regex matching as needed. Please note that the element must appear within 25 seconds otherwise the transaction will fail with a wait timeout.

Wait for 1 Second

Pauses for 1 second and then continues to the next step. Use this as a last resort if you need the browser to wait for some javascript to run. Usually using one of the “Wait for Element” steps is much more reliable.

Set Variable

Set a variable that can be used in subsequent steps. To use this variable in other steps as either an input or validation value, enclose the variable name in dollar signs ($). For example, you can use a variable such as CLIENT_NAME in a validation step text parameter as “Welcome, $CLIENT_NAME$”. The variable value can consist of alphanumeric characters, as well as an underscore. Variable names are case insensitive. The value of the "Options" field is treated differently depending on its variable type. Below are explanations per each type:

Element Text

Options: Element Name, ID, CSS Selector or XPath

The variable value is set from the contents of the element you’ve referenced. 

Current Date & Time

Options: Format string, eg MM/ DD/, YYYY h:mma z (Please utilize this link for all format specifiers)

The variable’s value is the current date and/or time in UTC. Use the specified format as cited/linked above.

Random Value

Options:

  • [Number-]Number, e.g. 100 or 1705-1980 - Random integer number in a specified range, or from 0 to specified number.
  • [Number:]List, e.g. 3:1,a,b,c,37 - Random string composed from Number (default 1) elements of List. The result from the example could be: 1b37.

The value of this variable is dependent on the string you’ve defined. 

Constant

Options: string

Validations

HTTP Status Code Should Be Status

Checks that the HTTP status code matches the specified status (eg. 200 or 404). You must enter a numeric HTTP status code. 

URL Should/Should Not Contain

Checks that the browser’s URL does or does not contain the given text or regex option (if enabled). Users can tick a box to enable regex as needed. Please note: regular expressions can also contain variables.

Title Should/Should Not Contain Text

Checks that the page title attribute does or does not contain the given text or regex option (if enabled). Users can tick a box to enable regex as needed. Please note: regular expressions can also contain variables.

Element Should/Should Not Exist

Checks that the specified HTML element does or does not exist on the page. Use the id, name or CSS selector of the element that should exist.

Element Should/Should Not Contain Text

Checks that the specified HTML element does or does not contain the given text or regex option (if enabled). Use the id, name, or CSS selector of the element, then define that text that it should contain. Users can tick a box to enable regex as needed. Please note: regular expressions can also contain variables.

Checkbox/Radio Button Should/Should Not Be Checked

Verify that the specified checkbox/radio button is or is not checked. Use the id, name or CSS selector of the element you wish to interact with.

Was this article helpful?
0 out of 0 found this helpful