DevWeb Proxy Recorder
The DevWeb Proxy Recorder enables you to record your business process from your chosen browser and export it to a HAR file. You can then generate a DevWeb script from the HAR file using the DevWeb Offline Script Generator tool.
The instructions here are for using the Proxy Recorder with LoadRunner Developer. The Proxy Recorder is also supported in VuGen.
Version update - note change in file locations:
- From version 2020 SP1 and later, the Proxy Recorder files are located under the DevWeb root directory, as indicated in the paths below.
- In earlier versions, the Proxy Recorder files are located under the <DevWeb Proxy Recorder root> directory. Adjust paths accordingly.
Prerequisite - install CA certificate
To record HTTP(S) traffic with secure communications, a Certification Authority (CA) certificate should be installed. This should be done before using the DevWeb Proxy Recorder for the first time. You install the certificate into your certificate repository on the Proxy Recorder machine, as a Trusted Root Certificate.
You can use the default CA certificate supplied with the Proxy Recorder, as described below, and install using the Certificate Import Wizard, or install from the command line. If you want to use your own custom certificate, see Create custom self-signed certificate.
To install the default certificate on Windows:
- In File Explorer, browse to the <DevWeb root folder>\cert\default_devweb_cert\default_devweb_cert.pfx file and open the right-click menu.
- Select Install PFX. The Certificate Import Wizard opens. Follow the on-screen instructions.
- On the Private key protection page, leave empty the Password field for the private key.
On the Certificate Store page:
- Complete the wizard to import the certificate.
To install the default certificate on MacOS:
From a terminal window (open with administrator privileges on Windows), change to the <DevWeb root>\cert\default_devweb_cert directory and run the following:
sudo security add-trusted-cert –d –r trustedRoot –k /Library/Keychains/System.keychain cert/default_devweb_cert/default_devweb_cert.cert
Run the DevWeb Proxy Recorder
The Proxy Recorder is ready to use, using default configuration settings.
If you want to customize the configuration settings, for example, to use your own CA certificate, different proxy server settings, or to set remote usage, then these should first be defined in the configuration file. For details, see Custom configuration for the Proxy Recorder.
To run the Proxy Recorder:
From your chosen browser, configure the proxy server settings for your internet connection. Set the host address and port to the ones used in the configuration file. The default values are:
- Default host: localhost
- Default port: 8156
The proxy must be set to be used for all addresses. For example, in Internet Explorer, make sure that Bypass proxy server for local addresses is not selected.
Open a terminal window and change to the DevWeb directory.
Start the Proxy Recorder by running one of the following from the command line, including a name for the HAR file where the recorded traffic will be saved (this is when using the default configuration file):
Version 2020 SP1 and later:
ProxyRecorder.exe <har result file name>
If you are using a custom configuration file, run the following:
ProxyRecorder.exe -c c:\local.recorder_config.yml <har result file name>
DevWebProxyRecorder.exe <har result file name>
If you are using a custom configuration file, run the following:
DevWebProxyRecorder.exe -c c:\local.config.yml <har result file name>
The Proxy Recorder window opens.
Perform your business flow in your web browser. Make sure to:
Open a new instance of the browser before each run.
Work in private browsing mode (for example, Incognito Mode in Chrome).
In the Proxy Recorder window, press Enter to finish recording and create the HAR file.
Log information for the recording is available in the console and in a log file (according to the configuration file settings.)
Note: Make sure that the process is complete before using the HAR file.
- Use the DevWeb Offline Script Generator tool to generate a DevWeb script from the HAR file.
The DevWeb Proxy Recorder configuration is contained in the <DevWeb root>\recorder_config.yml file. This file contains the default configurations needed to run the Proxy Recorder and must not be modified.
If you want to customize any configuration setting, you should do so in the local.recorder_config.yml file, located in the same folder. If this file does not exist, copy the config.yml file and name it local.recorder_config.yml. The settings in this file will override the default settings in config.yml.
For version 2020: The Proxy Recorder configurations are in <DevWeb Proxy Recorder root>\config.yml. Customized settings should be added to the local.config.yml file, in the same folder.
For example, you may need to customize settings for the following:
- Logger settings. Logging information for each Proxy Recorder run is saved to a log file and displayed in the console. You can change the default settings and log level.
- CA certificate. If you are using a CA certificate other than the one supplied with the DevWeb Proxy Recorder, add the path for the certificate folder to the custom_ca_certificate field. For more information, see Create custom self-signed certificate. (Supported from version 2020 SP2)
- Client-side certificate. For HTTPS requests that require a certificate, you can specify the path to the client-side certificate and key file in the client_certs field. The file must be in PEM format, and should contain both the unencrypted private key and the certificate.
- HTTP/2 support. By default, HTTP/2 support is enabled, and PRIORITY forwarding for HTTP/2 connections is disabled.
- Proxy host. By default, the Proxy Recorder listens for connections on localhost. To use a different host, customize the proxy_host field.
Remote usage or proxy recording. To enable remote usage of the Proxy Recorder instance, set the allow_remote setting to True.
Proxy settings for recording. The proxy settings you can define include the following:
- Proxy server details and credentials for proxy server authentication.
- PAC (Proxy Auto-Configuration) support, and the URL for the PAC configuration file. (Supported from version 2020 SP2)
- Authentication type to use: none, basic, or NTLM ("ntlm") (Supported from version 2020 SP2)
- Hosts to exclude when using the proxy.
Default browser. If you want the Chrome or Chromium to launch automatically when you start the Proxy Recorder, define it in launchBrowser.
- Chromium: This should also be added to the PATH environment variable.
- For version 2020: You can automatically launch the Chrome browser by setting launch_chrome_browser to True.
The DevWeb Proxy Recorder installation includes a default CA certificate, but if you prefer, you can create your own custom self-signed certificate.
The following provides instructions for Windows OS. For Linux or MacOS, use the appropriate OpenSSL commands.
To create a custom certificate:
- Download and install the latest version of OpenSSL. For example, for Windows, you can download from https://slproweb.com/products/Win32OpenSSL.html.
- Open the <DevWeb root folder>\cert\openssl.conf file. Under the Directory and file locations section, edit the dir field to point to the directory that will hold the created certificates. For example, you could use the custom_cert folder included under <DevWeb root folder>\cert.
- Open a terminal window (on Windows, open with administrator privileges), and change to the directory where you will store the created certificates.
Run the commands to create the files. The following examples use custom as the certificate name—replace with your own label, as relevant:
Create key and certificate files:
openssl req -config openssl.conf -new -x509 -sha256 -newkey rsa:2048 -nodes -days 3650 -keyout custom.key -out custom.cert
Create a PFX file that combines both cert and key:
pkcs12 -nodes -export -in custom.cert -inkey custom.key -out custom.pfx
Create the CA PEM file for the proxy (this must be named mitmproxy-ca.pem):
openssl pkcs12 -nodes -in custom.pfx -out mitmproxy-ca.pem -clcerts
Install the certificate on the Proxy Recorder machine, as a Trusted Root Certificate:
certutil.exe -importpfx Root custom.pfx
- In your local.recorder_config.yml, add the path to the folder to the custom_ca_certificate field. For example, <DevWeb root>\cert\custom_cert. For more information on using the local.recorder_config.yml file, see Custom configuration for the Proxy Recorder.
When recording scripts on Linux under a root user session and using the launchBrowser argument, Chrome cannot be launched. The Chrome browser does not support this configuration.
Workaround: Log in a different user, or manually launch the browser.