Real Browser User support is a way of simulating Internet access and browsers executing the transaction via a “real” browser (Real Browser Users or RBU). RBUs are heavily loaded as compared to the load generated by typical Virtual Users as an RBU uses a real browser to download web page components.

# Real Browser User Settings

The user can provide the following real browser settings.

## Run Virtual User as Real Browser User

Select this check box to run the virtual user as a real browser user. RBUs are heavily loaded as compared to the load generated by typical Virtual Users because RBUs use an actual web browser for fetching web page components.

## Execution Mode

Select the execution mode in which the user wants to execute the test. User can execute the test in two modes:

- Click And Script: By selecting this mode of execution, Page Average, Page Detail, and Page Score Report will be generated.
- Lighthouse: Lighthouse is an open-source and automated tool developed by Google for analyzing and improving the quality and performance of web pages and web applications. By selecting this mode of execution, a Lighthouse Report will also be generated.

## Agent

Users can select either the Cavisson agent or the Puppeteer agent.

- Cavisson Agent: LoadTest will use the Chrome extension which is used to derive the browser in the test.
- Puppeteer Agent: Puppeteer provides a high-level API for controlling headless Chrome or Chromium browsers over the DevTools Protocol. Puppeteer framework is used to derive the browser in the test. It is used for automating, testing, and interacting with web pages and web applications in a headless environment, meaning it operates without a GUI.

## Browser

The Browser shown depends on the Agent selected. If Cavisson Agent is selected, then the user can use Chrome and Firefox Browser and if Puppeteer Agent is selected, then the user can use the Chrome and Chrome Headless Browser. After selecting the browser, the user can select its version from the drop-down list.

In Cavisson Agent Chrome and Puppeteer Chrome, the only difference is that they will use their respective libraries.

- Chrome Headless: A headless browser is used to define browser simulation programs that do not have a GUI. These programs execute like any other browser but do not display any UI. That is the reason the user can’t see the display over VNC.

## User Agent String

A user agent string is a text string that a web browser or web client sends to a web server to identify itself and provide information about its capabilities. This string is part of the HTTP request headers sent when a user accesses a website. It includes information about browser, browser version, operating system, etc.

Select the following options from the drop-down for user agent string:

- Use the browser's default user agent
- As per user profile
- Use custom string

# Click And Script Options

## Video Clip Settings

- Capture video clip at specified time with specified resolution: Enabling this option allows you to capture the portion of video at the specific time. Users can also specifying the resolution from low to high for capturing the video as per need.
  - Start capturing only when DOM Threshold is X ms or Onload Threshold X ms: Check this, if user wants to capture the video clip when DOM threshold or ONLOAD threshold is reached.
- Capture rendering metrices without saving video by taking clips: It will capture snapshots at given time period and generate video from these snapshots.
- None: Select this option if user don't want to capture the video clip during the test.

Note :- By enabling the capture video or capture rendering metrics option user can see the Start rendering time and visual complete time metrics in the page average report.

## Content Delivery Network (CDN) Offload Settings

Here, the user can perform content delivery network (CDN) offload settings. CDN is the process of distributing and serving web content, such as images, videos, stylesheets, and scripts, from a CDN rather than directly from the origin server hosting a website.

- Enable CDN Offload: By enabling this option, CDN offload is enabled for all the requests. To enable CDN Offload for the specified domain, select the “Specified Domain” option from the drop-down and enter those domains in the Text box field. For multiple domains, use semicolons.

## Performance Tool Settings

- Enable Performance Tool (Supported only for Chrome Browser): By enabling this Performance tool setting, users can measure or analyze the performance of websites.
  - Timeout for saving Performance Tool data: Duration to save performance data.
  - Capture Screenshot: It will capture page snapshots to observe how the page will progress visually.
  - Capture Trace till Network becomes Idle (Default is 5 sec): It will capture the logs til the network becomes idle. By default, network will be idle for 5 sec.

## Cache and Cookie Settings

- Enable browser caching:
  Enable and select any one from the following for browser caching:
  - Clear cache on every session start: Clear all the cache at the beginning of each session can help ensure that your applications or system operate smoothly and efficiently.
  - Clear cache on every page start: A specific action where a web browser or application clears its cache each time a new web page is loaded.
  - Clear cache on every user action: It will clear the cached data every time when user perform an action within an application.
- Clear cookies on session start: Clear all stored cookies associated with a user's session are deleted at the beginning of a new browsing session.
- Stop browser after each session: After each session, the browser will be stopped ensuring that no active browsing or web-related processes remain open between sessions.

## TimeOut Settings

- Page Load Timeout: This defines the maximum waiting time in seconds for a VUser to wait for a page to load. If the page doesn't load within this duration, the page will be aborted, and any captured requests up to that point will be saved. This feature is particularly handy when a specific page's load time exceeds the configured limit in the test. The default value in the test is 60 seconds, which can be adjusted, but it will apply to all steps and pages.
- Network Idle Timeout: The network idle timeout, measured in milliseconds (msec), has a default value of 1500 msec. If the onLoad event is activated and there is no network activity for this period, the page will be deemed as loaded. It may be necessary to adjust this setting when the expected gap between two calls exceeds the default value of 1500 msec.
- Visual Idle Timeout: This parameter sets the visual idle timeout in milliseconds, with a default value of 1500 ms. After the network becomes idle, the VUser will wait for visual changes to stabilize. If there are no visual changes within this window of time after the network becomes idle, the page will be marked as visually complete. This functionality proves valuable when a specific page's load time exceeds the configured limit in the test.

## URL settings

- Block URL's before capture: This field is used to prevent/block the specified URLs from being accessed or loaded before any data or content from those URLs is captured. You can add multiple URLS by comma separated.
  - Use Case: Used to filter out specific websites or web pages from being visited, fetched, or interacted with, often for security, content filtering, or data privacy reasons
- Exclude URL pattern from request at the time of capturing data: If users want to exclude any URL pattern from the request at the time of capturing data so that they don't capture any data for that URL pattern, they can specify these in the text field. Multiple domains can be given separated by a comma.
  - Use Case: Many websites include URLs for tracking or advertising purposes. Excluding these URLs can help you focus on the core content of the website.

## Domain Settings

- Consider additional origin domains: Specify additional origin domain. It is used to hit actual origin domain instead of Service Virtualized request.You can also add multiple domains separated by comma.
- Enable domain based performance metrics: To analyze the resource timing for each domain, with the aim of identifying which resources consume significant time and which ones have shorter loading time.

## Additional Metrics

- Enable Mark and Measure: Mark is a timestamp that is created in the browser's performance entry buffer with the given name. Measure is a named timestamp between two marks, the start mark and the end mark, respectively. It helps a user to decide which parts of scripts are to optimize and instrument those parts of scripts with the User Timing API.
- Capture Time To Interact (TTI) metrics. TTI is captured using specification provided in primary content profile specified in ns_browser API in the script: Time to interact is the point when a user can interact with a web page element once the page has rendered. User can check metric in following reports i.e Page Average and Page Detail Report

## Waterfall Settings

- Save HTTP response body in waterfall: This is needed for page dumps without taking snapshots. Capture JavaScript requests in waterfall: By enabling this checkbox we can include JavaScript call timings in the waterfall.
- Capture BLOB request in waterfall: By enabling this checkbox we can include BLOB requests in waterfall.
- Enable creation of per-page CSV files using HAR data: To create a per-page CSV file for HAR data, check the given box.
- Calculate Page speed (Google Ranking): It generates time-series data for the page speed metric, It will be reflected in the page score report.
- Max number of requests in HAR File: To define a maximum number of requests in the HAR file, you will use this option by default 1000 requests captured in the HAR file. The number of requests in a HAR file is determined by the web page or web application being monitored and the specific interactions that are recorded during a browsing session.

## Advanced Settings

- Retry connection with browser extension: It will attempt to establish a connection to the browser as many times as specified by the given time interval.
- Browser additional arguments: Browser additional arguments are extra command-line parameters that can be provided when launching a web browser from the command line or through a script.

  For e.g. --disable-features=IsolateOrigins,site-per-process, --incognito, --enable-features=enable-virtual-keyboard, etc.

- Enable browser screen size simulation as per user profile: It will use the browser's screen size set in the test's user profile setting.
- Override HTTP headers as per the script: You can override HTTP headers define in the script for Main URL or Main and Inline URL.
- Capture page snapshot. If this is enabled, Network Logs will show this snapshot instead of the HTTP response: It will capture pagesnapshots to observe how page will progress visually. If user enable this checkbox, it will show snapshots instead of HTTP response in the Network Logs..
- Enable Application Monitoring: By enabling this user can drill down the page instance report.

# Lighthouse Options

## Lighthouse Settings

- Network Throttling: By enabling this option, user can control the rate of data transfer over a network connection.
  - Download Bandwidth: The rate at which data can be received or downloaded over a network connection.
  - Upload Bandwidth: The rate at which data can be uploaded over a network connection.
  - Network Latency: Delay in the transmission of data packets over a network.
    Note: These fields accept only the values that are greater than 0. If you provide values less than and equal to 0, an error message is displayed.
- Device Simulation: In the Device Simulation settings, you can enable either Desktop or Mobile simulation
- CPU Throttling: CPU Throttling is a behavior where processes are slowed when they are about to reach some resource limits. OR
  CPU throttling occurs when you configure a CPU limit on a container, which can invertedly slow your application's response time. OR
  CPU throttling is used to automatically slow down the computer when possible to use less energy and conserve battery, especially in laptops.
  You can configure the CPU Throttling by selecting the following options from the drop down:
  No Throttling
  2X Slow
  4X Slow
  6X Slow
  8X Slow
  Custom

## Advanced Settings

- Override HTTP headers as per the script: You can override HTTP headers define in the script for Main URL or Main and Inline URL.
- Override browser profile settings from the provided profile: By enabling this option, you can override the browser profile settings from the provided profile by giving the absolute path.
- Page Load Timeout: This defines the maximum waiting time in seconds for a VUser to wait for a page to load. If the page doesn't load within this duration, the page will be aborted, and any captured requests up to that point will be saved. This feature is particularly handy when a specific page's load time exceeds the configured limit in the test. The default value in the test is 60 seconds, which can be adjusted, but it will apply to all steps and pages.
- Heap Size: Amount of memory allocated for dynamic memory allocation. User can add define the heap size by auto or manual. By default heap size is 512 MB, you can change it by manually.

# Why Use A Headless Browser For Test Execution ?

## Run tests efficiently and speedily

The performance with a headless browser is better compared to real browser automation. The real browsers like Google Chrome, Firefox, and Internet Explorer take a significant amount of time to load CSS, JavaScript, Images, and open and render HTML. Headless browsers do not require all this to load and will start performing functions without waiting for a page to load completely. When we need to run the regression scripts, in headless browsers, we could save time as they are much faster and can render results quickly.

## Limitation

Debugging will not be feasible, as the only way to check what's running on the browser is to grab the screenshots and validate the output.

The user cannot see the test execution in VNC as it is a non-UI execution. Headless browsers don't mimic the exact user behavior. The page doesn't render precisely with all the dependencies that it will render in an actual browser.not be feasible, as the only way to check what's running on the browser is to grab the screenshots and validate the output.

Cosmetic bugs like the location of a web element and color of a web element may get missed while running the tests in headless mode.

Cosmetic bugs like the location of a web element and color of a web element may get missed while running the tests in headless mode.

#### Runtime Changeable: No