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.
Install the CA certificate (prerequisite)
To record HTTP(S) traffic with secure communications, a Certification Authority (CA) certificate must 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 and install using the Certificate Import Wizard, or install directly 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 from the CLI:
From a terminal window (open with administrator privileges), change to the <DevWeb root> directory and run the following:
certutil.exe -f -p "" -importpfx Root ./cert/default_devweb_cert/default_devweb_cert.pfx
Alternatively, if you have configured the environment variable DEVWEB_PATH, you can open a terminal window with administrator privileges from any location and run:
certutil.exe -f -p "" -importpfx Root "%DEVWEB_PATH%/cert/default_devweb_cert/default_devweb_cert.pfx"
To install the default certificate on Windows using the Import Wizard:
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.
Tip: Check out the video: Tutorial #3: Recording using theProxy 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):
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>
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, click 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 example, you may need to customize settings for the following:
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.
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.
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.
|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:
If you want the Chrome or Chromium browser to launch automatically when you start the Proxy Recorder, define it in launchBrowser.
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.
The Chrome browser cannot be launched when recording scripts on Linux under a root user session and using the launchBrowser argument. Chrome does not support this configuration.
Workaround: Log in as a different user, or manually launch the browser.