Docs » Use a Browser test to test a webpage » Add synthetic transactions to your Browser Test

Add synthetic transactions to your Browser Test đź”—

Use synthetic transactions in your Browser Tests to test multi-step user flows and transactions.

What are synthetic transactions? đź”—

A synthetic transaction is a group of one or more logically related interactions that represent a business-critical user flow, such as the login process or a checkout flow. Synthetic transactions are made up of steps.

Splunk Synthetic Monitoring generates the following additional metrics for each synthetic transaction:

  • Duration: Total duration for the synthetic transaction

  • Requests: Total number of requests made during the synthetic transaction

  • Size: Total size of the content loaded during the synthetic transaction

You can create multiple synthetic transactions in a given test to measure size, duration, and requests for multiple workflows across multiple pages.

What are steps? đź”—

Steps are interactions with a webpage that require user input. By adding steps to your Browser Test, you can simulate choices or interactions that a user might make and test how your application behaves in response.

Example steps include:

  • Clicking a link

  • Entering information in a field

  • Selecting a value from a drop-down menus

  • Accepting or dismissing an alert

  • Running and saving values from JavaScript

  • Saving text from an element

You can identify specific page elements involved in these steps by their id, name, XPATH, CSS Path, link, or JS path. Use developer tools to interact with the DOM (inspector) and JavaScript (console) to identify and interact with the elements of a site.

To learn more about all available types of steps, see Types of steps you can include in your Browser Tests below.

A step doesn’t generate its own dedicated metrics, but it counts toward the metrics for the synthetic transaction it belongs to. Additionally, when a step triggers a new page load, the page load triggers the set of page load metrics.

Types of steps you can include in your Browser Tests đź”—

The following table describes the types of steps you can include:

Type of step

Description

Accept alert

Accept an alert that appears on the page.

Dismiss alert

Dismiss an alert that appears on the page.

Clear

Clear an element you identify under Selector. Optionally, wait for navigation.

Click

Click on an element you identify under Selector. Optionally, wait for navigation.

Fill in field

Fill a field you identify under Selector with a value you provide under Value. Optionally, wait for navigation. For security and reusability, use a built-in, custom, or global variable to provide the value. See Create and use Global Variables to learn more.

Go to URL

Navigate to a URL you provide under Value.

Execute JavaScript

Execute a piece of JavaScript you provide under Value. Optionally, wait for navigation.

Select

Select an element you identify under Selector. Choose the value you identify under Value. Optionally, wait for navigation.

Save text from element

Save the text an element you identify under Selector, as the variable you provide under Variable.

Switch to iframe

Switch focus to an embedded document in an inline frame, identified under Selector.

Switch to main

Switch focus back to the main frame of the webpage.

Wait for text present

Wait until the text identified in the key-value pair under Value appears on the webpage.

Wait for text present

Wait until the text identified in the key-value pair under Value appears on the webpage.

Wait for text not present

Wait until the text identified in the key-value pair under Value is not present on the webpage.

Wait for element present

Wait until the element you identify under Selector is present on the webpage.

Wait for element not present

Wait until the element you identify under Selector is not present on the webpage.

Wait for element visible

Wait until the element you identify under Selector is visible on the webpage.

Wait for element not visible

Wait until the element you identify under Selector is not visible on the webpage.

Add synthetic transactions to your Browser Test đź”—

Follow these steps to create a Browser Test with synthetic transactions:

  1. From the Splunk Synthetic Monitoring landing page, click Add new test > Browser test to start creating a Browser Test. See Set up a Browser test for more details.

  2. While creating your Browser Test, select Edit steps or synthetic transactions. Your current configuration and detector selections are preserved and the Add synthetic transactions view opens.

  3. Enter a name for your synthetic transaction, such as “Log in” or “Begin search.”

  4. Enter a name for the first step in your synthetic transaction.

  5. Use the picker to choose the type of step from the dropdown. See Types of steps you can include in your Browser Tests to learn more about the options.

  6. If your step type requires you identify an element by Selector, enter the following.

    • Selector type: Choose the selector type, from among id, name, XPATH, CSS Path, link, or JS path

    • Selector path: Enter the path used to identify the selector you’re using, conforming to the selector type you chose.

  7. If your step type requires that you enter a Value, you can either type a raw value, or use a built-in, custom, or Global Variable here. You can select a variable name from the Variables tab to copy it and paste it in the field where you’d like it to be entered.

  8. If your step type has the option to Wait for navigation, check the checkbox if you’d like the test to wait for a 2 second delay to allow the specified action to be executed.

  9. (Optional) Create additional steps and synthetic transactions using the + Step and + Synthetic transaction buttons. Click and drag steps and synthetic transactions to rearrange their order.

  10. (Optional) Use the Test settings tab to adjust your test configuration settings. See Manage synthetic tests to learn more.

  11. (Optional) Use the Detectors tab to add detectors to your test. See Set up detectors and alerts in Splunk Synthetic Monitoring to learn more.

  12. When you’re satisfied with your transactional Browser Test, select Save.