Design a RealBrowser user path

Recording a RealBrowser user path is a great way to start creating a new business case scenario. However, if you want to add flow control, variables, or more complex browser interactions, you need to manually add them into the user path. This takes place in a phase called Designing.

RealBrowser designing leverages most of the existing NeoLoad design capabilities, and adds the following actions to help you handle most use cases when using the browser.

RealBrowser actions

Actions are the building blocks of your user path. Each action simulates something a real user would do: click a button, type text, or go to a page.

Frame parameters

To interact with content inside an iframe, use frame parameters. Use one of the following options per action:

  • frameIndex: The zero-based index of the iframe (0 for the first iframe, 1 for the second, and so on).

  • frameName: The name attribute of the iframe element.

  • frameSelector: A CSS or XPath selector to identify the iframe.

Navigation parameters

To wait for a page to load before continuing, use navigation parameters:

  • waitForNavigation.url: Confirms that navigation leads to a specified URL in regular expression format.

  • waitForNavigation.timeout: Maximum wait time for navigation in milliseconds.

  • waitForNavigation.until: Defines when the system considers navigation complete. Options: LOAD, DOMCONTENTLOADED, NETWORKIDLE, COMMIT.

Download parameters

To test a download feature, use download parameters to wait for and capture files:

  • waitForDownload: Waits for a file download to complete.

  • waitForDownload.path: File path where the downloaded file is stored.

CaptureRequests

Configures the capture of HTTP request metrics for analysis. Use this action to monitor request and response times between the browser and server.

This action uses the following parameters:

  • includeCache (optional): Includes requests loaded from browser cache. Default is false (network requests only). Set to true to include cached requests.

  • regexp (optional): Groups requests using a regular expression. The system matches against the full URL including scheme, hostname, port, path, and parameters. If not specified, all requests are aggregated into a single group.

  • resourceType (optional): Groups requests by resource type. Supported types: document, stylesheet, image, media, font, script, texttrack, xhr, fetch, eventsource, websocket, manifest, ping.

  • url (optional): Groups requests by exact URL match, excluding query parameters.

Click

Clicks an element on the page.

This action uses the following common parameters:

  • selector (required): Identifies the element to click. Supports text, CSS, and XPath selectors.

  • doubleClick (optional): Performs a double-click. Default is false.

  • mouseButton (optional): Mouse button to use. Options: LEFT (default), MIDDLE, RIGHT, BACK, FORWARD.

  • modifiers (optional): Keyboard modifiers to hold during click. Separate multiple modifiers with +. Example: Control+Shift.

You can also configure these advanced parameters:

  • force (optional): Forces the click even if other elements obscure the target. Use with caution. Default is false.

  • coordinates (optional): Click coordinates relative to the element. Format: x;y. If not specified, clicks the center of the element.

  • timeout (optional): Action timeout in milliseconds.

  • ignoreErrors (optional): Ignores errors if the action fails. Useful for conditional actions. Default is false.

The Click action also supports frame, navigation, and download parameters.

CloseBrowser

Closes the browser and ends the browser session.

This action uses the following parameters:

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

  • shouldStopProcesses (optional): Applies only when the action is in the Actions container. When set to true, closes and recreates all external processes for each iteration. This increases response time and CPU usage for both CloseBrowser and subsequent OpenBrowser actions. Default is false.

CloseTab

Closes a browser tab at the specified index.

This action uses the following parameters:

  • index (required): Zero-based index of the tab to close. For example: 0 closes the first tab, 1 closes the second tab.

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

Download

Waits for and handles a file download.

This action uses the following parameters:

  • waitForDownload.path (required): File path where the downloaded file is stored.

  • ignoreErrors (optional): Ignores errors if the download fails. Default is false.

EvaluateJavaScript

Executes JavaScript code in the current page context. Use this action to interact with page elements, extract data, or manipulate the Document Object Model (DOM).

This action uses the following parameters:

  • script (required): JavaScript function or expression to execute.

  • variableName (optional): Variable name to store the JavaScript execution result.

  • ignoreErrors (optional): Ignores errors if the script fails. Default is false.

This action also supports frame, navigation, and download parameters.

HandleBrowserDialog

Configures how the browser handles JavaScript dialogs.

This action uses the following parameters:

  • behavior (required): Action to take when a dialog appears. Options: DISMISS (default), ACCEPT.

  • promptText (optional): Text to enter in prompt dialogs.

  • times (optional): Number of times to repeat this behavior throughout the user path. Default is 1.

MouseOver

Positions the mouse over an element or specific coordinates. The system automatically scrolls if the position is outside the viewport.

This action uses the following parameters:

  • selector (required): Identifies the element. Supports text, CSS, and XPath selectors.

  • coordinates (optional): Mouse coordinates relative to the element (or absolute if no selector). Format: x;y. If not specified, positions mouse at element center.

  • timeout (optional): Action timeout in milliseconds.

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

The MouseOver action also supports frame and navigation parameters.

Navigate

Goes to a specified URL in the browser.

This action uses the following parameters:

  • url (required): URL to visit. Must include the scheme (http:// or https://).

  • ignoreErrors (optional): Ignores errors if navigation fails. Default is false.

This action also supports navigation parameters.

OpenBrowser

Opens a new browser instance to start a browser session.

This action uses the following basic parameters:

  • browser (required): Browser type. Options: chromium (default), firefox, or webkit.

  • channel (optional): Browser distribution channel. Options: chrome, chrome-beta, chrome-dev, chrome-canary, msedge, msedge-beta, msedge-dev, msedge-canary, or chromium.

  • executablePath (optional): Path to a custom browser executable. Use with caution as compatibility is not guaranteed.

  • headless (optional): Runs browser in headless mode (no visible window). Set to true for headless.

You can configure display settings with these parameters:

  • resolution (optional): Browser window resolution. Format: widthxheight. Example: 1920x1080.

  • locale (optional): Browser locale. Example: en-GB, fr-FR.

  • timezone (optional): Browser timezone. Example: Europe/Paris.

  • userAgent (optional): Custom user agent string.

You can configure authentication with these parameters:

  • httpCredentials.login (optional): Login for HTTP authentication (Basic, NTLM, or Kerberos).

  • httpCredentials.password (optional): Password for HTTP authentication.

  • httpCredentials.origin (optional): Origin that receives the credentials. Example: https://example.com.

You can configure network settings with these parameters:

  • header (optional): Adds custom headers to browser requests. Format: (host) name=value or name=value. Add multiple header parameters as needed.

  • blockRoute (optional): Blocks all resources matching the specified route pattern.

  • ignoreSSLCertificateErrors (optional): Ignores SSL certificate errors. Not recommended for production testing. Default is false.

You can configure timeout settings with these parameters:

  • defaultTimeout (optional): Default timeout for all actions in milliseconds.

  • defaultNavigationTimeout (optional): Default timeout for all navigations in milliseconds. Default is 20000.

You can configure permissions and security with these parameters:

  • permissions (optional): Grants browser permissions based on a comma-separated list. For example: geolocation, notifications, camera, microphone.

  • geolocation (optional): Overrides browser geolocation. Format: latitude,longitude,accuracy in decimal format.

  • bypassCsp (optional): Bypasses Content Security Policy. Use with caution. Default is false.

You can configure testing behavior with these parameters:

  • ignoreScreenshots (optional): Disables screenshots during Check VU or Debug.

  • ignoreErrors (optional): Ignores errors if browser fails to open. Default is false.

OpenTab

Opens a new browser tab at the rightmost position.

This action uses the following parameters:

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

Press

Presses a keyboard key on an element.

This action uses the following parameters:

  • selector (required): Identifies the element. Supports text, CSS, and XPath selectors.

  • key (required): Key to press. Examples: Enter, Escape, Tab, ArrowDown.

  • delay (optional): Delay in milliseconds between keydown and keyup events.

  • timeout (optional): Action timeout in milliseconds.

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

The Press action also supports frame, navigation, and download parameters.

Read

Reads text content or attribute values from an element.

This action uses the following parameters:

  • selector (required): Identifies the element. Supports text, CSS, and XPath selectors.

  • variableName (optional): Variable name to store the extracted text or attribute value.

  • attribute (optional): Attribute name to read. If not specified, reads the element's text content.

  • timeout (optional): Action timeout in milliseconds.

  • ignoreErrors (optional): Ignores errors if the element is not found. Default is true.

The Read action also supports frame parameters.

Scroll

Scrolls the window by a specified number of pixels. Use for infinite scrolling or revealing content.

This action uses the following parameters:

  • X (optional): Pixels to scroll horizontally. Positive values scroll right, negative values scroll left. Default is 0.

  • Y (optional): Pixels to scroll vertically. Positive values scroll down, negative values scroll up. Default is 0.

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

The Scroll action also supports navigation and download parameters.

SelectOption

Selects one or more options from an HTML select element.

This action uses the following parameters:

  • selector (required): Identifies the select element. Supports text, CSS, and XPath selectors.

  • options[0].text (optional): Selects option by visible text.

  • options[0].value (optional): Selects option by value attribute.

  • options[0].index (optional): Selects option by zero-based index.

  • timeout (optional): Action timeout in milliseconds.

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

For multiple selections, add more option parameters with different indexes: options[1].text, options[2].value, and so on.

This action also supports frame and navigation parameters.

SwitchTab

Switches focus to a different browser tab.

This action uses the following parameters:

  • index (required): Zero-based index of the tab. Example: 0 switches to the first tab, 1 switches to the second tab.

  • ignoreErrors (optional): Ignores errors if the tab doesn't exist. Default is false.

Type

Types text into an input element.

This action uses the following parameters:

  • selector (required): Identifies the input element. Supports text, CSS, and XPath selectors.

  • text (optional): Text to type.

  • encryptedText (optional): Encrypted text for password inputs.

  • mode (optional): Typing mode. Options: FILL (default, instant), TYPE (realistic, types character by character).

  • delay (optional): Delay in milliseconds between keystrokes when using TYPE mode. Default is 100.

  • timeout (optional): Action timeout in milliseconds.

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

The Type action also supports frame, navigation, and download parameters.

UploadFile

Uploads one or more files to a file input element.

This action uses the following parameters:

  • selector (required): Identifies the file input element. Supports text, CSS, and XPath selectors.

  • filePaths (required): Semicolon-separated list of file paths to upload. Use ${NL-CustomResources} to access files in the project's custom-resources folder on the Load Generator.

  • timeout (optional): Action timeout in milliseconds.

  • ignoreErrors (optional): Ignores errors if the action fails. Default is false.

This action also supports frame and navigation parameters.

WaitSelector

Waits for an element to reach a specific state before continuing.

This action uses the following parameters:

  • selector (required): Identifies the element to wait for. Supports text, CSS, and XPath selectors.

  • state (optional): Element state to wait for. Options: visible (default), attached, detached, or hidden.

  • timeout (optional): Maximum wait time in milliseconds.

  • selectorLogicalOperator (optional): Logical operator for multiple selectors. Options: AND (default), OR.

  • ignoreErrors (optional): Ignores errors if the element doesn't reach the expected state. Default is false.

The WaitSelector action also supports frame parameters.

Using variables

All Browser actions have parameters where variables from the Variable Manager can be leveraged.

For example, you can set a BrowserType action text parameter to a variable that takes its source from the Variable Manager. This makes it so that on each iteration a different text is set in the target element.

The syntax for using variables is the dollar sign followed by the name of the variable in between braces : ${myVariable}

Deal with iframes

iframes are web pages embedded in the main page. When you use actions that target an element, the scope for the selector parameter is implicitely the main frame. To execute an action on an element existing inside an iframe, add a frameName or frameIndex parameter.

  • frameName is the more stable way to locate your iframe, but it requires iframe to have a name attribute.

  • frameIndex is the fallback method of locating your iframe, it identifies the iframe with its index based on its order of appearance in the DOM.

Deal with browser tabs

Tabs can be opened at any time during a user path. Once you have multiple tabs open at the same time, you need to explicitly choose which tab is the current focused tab that will receive all the following actions.

Tabs are managed by 3 actions:

  • OpenTab: Opens a new tab to the right.

  • SwitchTab: Swith to specified tab index. The parameter index specify the tab to switch (is 0-based, the first tab is 0, the second is 1, etc.).

  • CloseTab: Close the current tab.

User path synchronization

RealBrowser actions are built with a retry-until-timeout mechanism. This eases your journey to a working and stable user path. For example, if you want to click on a button in the current page, that click will be tried until it is successfully performed, or a timeout has occurred.

Additionally, there are several ways for you to insert waits and pauses between actions to ensure actions are flowing correctly.

Adding think times and delays

When confronted with a new page, screen, or component on the page, some users require time to respond.

Using NeoLoad think times and delays allows you to add pauses to the flow of actions. This emulates the way a real user behaves.

Think times are a main tool to run scenarios at scale. Without them, depending on your load policy, the load generator can send orders to different browsers at the same time and this can lead to an increase in CPU consumption.

Adding pacing is the best way to increase the number of parallel virtual users when you start to hit infrastructure capacity limits.

Adding WaitForSelector actions

This RealBrowser action is useful when you want to assert the presence, absence, or visibility of an element before interacting with another.

For example, if you have a button that is enabled and ready to click, but you want to wait for a specific text content to appear before clicking it, the WaitForSelector allows you to do that.

Using waitForNavigation parameters

Use waitForNavigation* parameters to assert and ensure that a navigation has occurred after the action that is set has been performed.

Each action that is marked with at least one parameter creates a page result where the loading time of the page is collected and aggregated.

There are three parameters: 

  • waitForNavigation.url: assert that the navigation leads to the specified url (in regular expression format).

  • waitForNavigation.timeout: assert that the navigation is performed under the specified timeout (default 10s).

  • waitForNavigation.until: defines the kind of event that marks the end of the navigation.

    • LOAD: the navigation is declared finished when the page emits an onload event (default mode)

    • DOMCONTENTLOADED: the navigation is declared finished when the page emits a domcontentloaded event

    • NETWORKIDLE: the navigation is declared finished when the page has made no new network calls since 500ms

    • COMMIT: the navigation is declared finished as soon as the request has been sent

Not all pages emit the defaulted LOAD or DOMCONTENTLOADED events. If you have an action with a waitForNavigation that relies on one of these, a failed assertion or timeout might be returned. In this case, switch to the NETWORKIDLE or COMMIT mode.

Design limitations

  • Some Browser Actions allow multiple selector parameters to be defined. This use increases the resilience of the action to application changes. You can only mix:

    • Multiple CSS selectors together.

    • Multiple XPath selectors together.

    • "Text=" selectors cannot be mixed with other selectors.

  • Drag'N'Drop.

  • Alerts management (disabled by default).

  • Cookies and LocalStorage management (use the evaluateJavascript action instead).

  • SVG interactions.

  • Downloaded file assertions.

  • Fork (flow control) actions are not compatible with RealBrowser actions.

Run a RealBrowser User Path

Running a RealBrowser User Path requires a license with the RealBrowser feature enabled. Make sure that the amount of VUs you require at runtime is available on the license or on your current lease.

When you run a RealBrowser scenario, take into account that the Load Generator spins a browser instance for each required Virtual User. This means that the CPU and Memory footprint on your current machine is bigger than a classic protocol scenario.

With RealBrowser, the main mission of the Load Generator is to send orders to the browsers that do the bulk of the work. The LG's JVM should be tuned to around 15% of the available host memory, leaving plenty of memory for the browser instances that pile up.

Logging

In addition to the NeoLoad usual logfiles, you can also read the browsers.log file to trace and debug messages coming from the browser at runtime.

From the GUI, you can access the logs folder in the Help > Open log folder menu.

Using an application proxy

RealBrowser testing inherits from the NeoLoad Application Proxy settings for reaching apps behind a proxy.

In Edit > Preferences > Proxy, you can add a new proxy with the Add button, and select that proxy or an already existing one in the Application Proxy dropdown.

For the selected Application Proxy to be valid, it must be a manual settings, otherwise a warning will display in the logs.

Automatically detected settings or configuration script (PAC) are not supported in RealBrowser.

The proxy URL that will be used will match the protocol of the targeted application as described in the first Navigate action encountered in the RealBrowser user path.

In the example screenshot below, if you navigate to https://my-app.com, the URL for the proxy will be https://some-proxy-url.com:443.

You may also skip the usage of the proxy for requests going to specific domains using the Do not use proxy for these addresses text field.

Allowed syntax for domains are :

  • Domain: my-app.com

  • Subdomain: sub.my-app.com

  • Any subdomain: .my-app.com

Finally, you can toggle the Authenticate to proxy option and add a login/password combination if your proxy requires so.

Once enabled, all requests emitted by the browser will pass through that Application Proxy (besides those explicitly skipped).

When no application proxy is defined, the running browser will use its default policy. For some of them such as Chromium, the system proxy will be used.

Monitoring the infrastructure

RealBrowser test will take more resources than Protocol test due to browsers footprint.

You have to monitor your infrastructure to calibrate how much Virtual User a Load Generator is able to handle.

The memory used by browsers is different than the memory used by the Load Generator, so you do not have to increase the Load Generator Xmx.

Metrics to monitor on the Load Generator :

  • CPU Load => The more restrictive resource will often be the CPU, so this is important to monitor this metric and be sure that it does not go exceed 80%.

  • OS Memory Used => It will represent the total memory used of the Load Generator, including browsers.

  • JVM Memory Used => Does not include browsers memory but it is important that the amount does not exceed 80%.

Analyze a Browser Based User Path

Data model

The following table describes the data objects that can be analyzed during and after a Test Run.

Data type Description Metrics
Transactions

Transactions are a collection of actions that represent a concrete business case.

The value they hold is the sum of the duration of all their children actions.

Duration (Min, Max, Avg), Count, Errors, Error rate, Elements/Second, Std Dev, Avg-90%, Percentiles (50, 95, 99)
Actions The resulting duration of an action is the time it takes to complete. Completion depends on the type of action being used, see Action timings. Duration (Min, Max, Avg), Count, Errors, Error rate, Elements/Second
Pages

Page metrics are generated only from RealBrowser actions marked with waitForNavigation parameters

Duration (Min, Max, Avg), Count, Errors, Error rate, Elements/Second, Time to First Byte (Min, Max, Avg)
Requests Requests metrics will contain metrics related to each HTTP request made by the browser. Duration (Min, Max, Avg), Count, Errors, Error rate, Elements/Second, Time to First Byte (Min, Max, Avg), Throughput

Action timings

RealBrowser actions return a timing after they are executed. The nature of this timing depends on the type of the action, which can be divided into three families:

  • Actions that have an effect on the browser (OpenBrowser, CloseBrowser, OpenTab, CloseTab, SwitchTab):

    • These actions return the time it took for the operation to complete.

    • OpenBrowser can take a few seconds to launch.

    • Other actions should be consistently quick to execute (0.1-0.2s)

  • Actions that lead to a page navigation (Navigate)

    • These return the page load time, based on the onload event.

    • Determines that the page has loaded using the parameter waitForNavigation.until

  • Actions that have an effect on the page (Click, Type, Press, SelectOption, EvaluateJavascript, UploadFile)

    • These return the time it takes for the operation to complete, depending on the DOM state.

    Example: If you click on a button, and that button is enabled, visible, and accessible, the action will execute quickly (0.1-0.2s. However, if you click a button but it is disabled because some javascript logic has not been processed yet, the waiting time is integrated into the total action timing. This remains until the button becomes enabled and the click can occur.

  • You can declare that actions lead to a navigation by using the parameter waitForNavigation.url. In this case, the target page load timing is integrated into the action timing.

    • Actions that are marked with waitForNavigation parameters also generate statistics in the Page section of NeoLoad Analysis.

Headless mode

Headless mode is the capacity of a browser to run without a user interface.

Headless mode, if unspecified in the OpenBrowser parameters, is set to true by default at runtime, and false by default at Check VU.

When using Chromium headless mode, you have two choices:

  • Legacy Headless mode: Consumes less CPU, better for scaling.

  • New Headless mode: Consumes a bit more CPU, behavior is closer to headed Chromium.