Build TruWeb scripts

This topic describes different options for building your TruWeb script. You can create a script using VuGen, generate it from a HAR file, or develop it manually using your preferred IDE or text editor.

For details about the structure of a TruWeb script, see TruWeb script structure.

Write a TruWeb script manually using external tools

You can write scripts manually using the TruWeb JavaScript SDK. Industry standard scripting capabilities such as transactions, parameters, correlations, and run logic are supported.

The following HTTP features are supported, among others:

  • Synchronous web requests

  • Asynchronous web requests
  • Headers

  • Body

  • Caching

  • Cookies

  • Page resources

  • HTTP error code handling

You can work with a variety of IDEs and text editors, for example,, or JetBrains WebStorm (IntelliJ). For more information on working with common IDEs, see Configure TruWeb for your IDE.

Back to top

Record a script

You can record a business process into a HAR file, and then use the TruWeb Offline Script Generator tool to generate a TruWeb script from the HAR file.

For more information, see Create TruWeb scripts from recordings.

Back to top

Create/Edit a TruWeb script in VuGen

Create your script in VuGen by selecting TruWeb in the Protocols list. When the script loads, write the script code in the main.js file using the TruWeb JavaScript SDK.

You can also import a TruWeb script created with a tool other than VuGen, and continue to edit in VuGen.

To import a TruWeb script into VuGen:

  1. In VuGen, select File > Open > Import TruWeb Script.
  2. Browse to your script's main.js file and click Open.
  3. Enter a name for your script, and the location where you want to save the imported script.
  4. Click Import.

For information about the TruWeb script structure, see TruWeb script structure.

For information about creating VuGen scripts, see the VuGen Help Center.

Note: To run a TruWeb script using LoadRunner/Performance Center, you need to first import the script into VuGen.

Back to top

See also: