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 đź”—
Assertions are checks to see what state an object exists in, for example if text is present or an element is visible. The following table describes the types of steps you can include for actions:
Type of step |
Description |
---|---|
Accept alert |
Accept 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. |
Dismiss alert |
Dismiss an alert that appears on the page. |
Fill in field |
Fill in the field you identify under Selector with a value you provide in the Value field. For security and reusability, you may want to use a built-in, custom, or global variable in the Value field. Reference a custom variable as |
Go to URL |
Navigate to a URL you provide in the URL field. |
Execute JavaScript |
Execute a piece of JavaScript you provide under Value. Optionally, wait for navigation. |
Save return value from Javascript |
Execute a piece of JavaScript you specify in the JavaScript field. If the script returns a value you want to save, specify a name for the saved value in the Variable field. This creates a custom variable which you can reference in subsequent steps as |
Save text from element |
Save the text an element you identify under Selector, as the variable you provide under Variable. |
Select |
Select an element you identify under Selector. Choose the value you identify under Value. Optionally, wait for navigation. |
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 |
Wait a certain number of minutes. See, Limits and defaults for configurable wait times. |
Add synthetic transactions to your Browser Test đź”—
Follow these steps to create a Browser Test with synthetic transactions:
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.
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.
Enter a name for your synthetic transaction, such as “Log in” or “Begin search.”
Enter a name for the first step in your synthetic transaction.
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.
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.
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.
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.
(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.
(Optional) Use the Test settings tab to adjust your test configuration settings. See Advanced test configurations to learn more.
(Optional) Use the Detectors tab to add detectors to your test. See Detectors and alerts to learn more.
When you’re satisfied with your transactional Browser Test, select Save.