TruWeb Offline Script Generator tool
Use TruWeb's Offline Script Generator to generate an executable TruWeb script from a list of web requests compiled in a HAR or CSV file.
Tip: For details about recording HAR files for TruWeb, see Record and generate a TruWeb script.
Generate the TruWeb script
This section describes how to use the Offline Script Generator tool to generate a TruWeb script from a HAR or CSV file.
Note: TruWeb supports CSV files from StormRunner Load (LoadRunner Cloud) only, and not other CSV formats. For details on the supported SRL CSV format, see Create a test using a CSV file in the StormRunner Load Help Center.
To run the Offline Script Generator tool:
Open a terminal window and change to the TruWeb installation directory.
Run the following command:
OfflineGenerator -mode=<mode type> -level=<script level> -config=<path to config file> <path to source file> <destination path>
with the following key values:
Define the mode type, to indicate the format of the file used to generate the script.
Value: har or csv
Define the script level to generate: a url-based script, or pages with a resource-based script.
Value: url (default) or pages
Provide the path to the configuration file from which to generate the script.
Note: If not provided, the default configuration file for this tool, generator_config.yml (located in the TruWeb installation folder), is used. For more details, see Offline Script Generator configuration file (generator_config.yml) below.
<path to source file> Provide the full path to the HAR/CSV file from which to generate the script. <destination path> Provide the full path to the folder in which to save the generated script.
In the following example, pages with a resource-based script are generated from a HAR file:
OfflineGenerator -mode=har -level=pages myFile.har Scripts/MyScriptDirectory
In the following example, pages with a resource-based script are generated from a HAR file, using a configuration file:
OfflineGenerator -mode=har -level=pages -config=config/file.yml OfflineGenerator/input/HAR/json_pages.har C:\jsonPages
The following example generates the script from a CSV file, using a configuration file:
OfflineGenerator -mode=csv -config=config/file.yml OfflineGenerator/input/CSV/example-csv-file.csv C:\csv-file
The default configuration file for the Offline Script Generator (located in the TruWeb installation folder), contains configurations that are specific to the Offline Script Generator.
These configurations include:
- Logging options during script generation
- Filtering for the generated web requests which can include specific headers or specific URLs
- Correlation rules to apply during script generation - see Correlate dynamic values.
- Special body formatting
- Summary report generation
For more information about the configuration settings, see the generator_config.yml file (in the TruWeb installation folder) where you can see descriptions of the settings alongside each setting.