Creating Vuser Scripts or Unit Tests in Visual Studio or Eclipse

The following sections describe how to develop a Vuser script or unit test through programming within the Visual Studio or Eclipse environments.

LoadRunner provides add-ins that allow you to develop scripts with supported versions of Visual Studio or Eclipse.

Note: For details on supported Eclipse versions, see the System Requirements.

There are two types of add-ins:

  • Visual Studio/Eclipse IDE add-in

  • Visual Studio/Eclipse IDE add-in for Developers

The basic IDE add-in allows you to create a Vuser script within the Visual Studio or Eclipse environment. You program a standard Vuser script using standard C# functions or protocol-specific functions from the Function Reference, within your native environment. You can then use the script in your testing environment, for example, in a LoadRunner scenario.

The IDE add-in for Developers allows you to create and run a unit test directly from within Visual Studio or Eclipse. The run mechanism is VuGen's mdrv process. This add-in adds a Devops menu to the Visual Studio or Eclipse interface. You can configure runtime settings directly from your development environment and run the test. The saved tests, NUnit (Visual Studio) or JUnit (Eclipse), can be referenced directly from your testing environment, for example, a LoadRunner scenario.

These add-ins are provided in Additional Components folder of your LoadRunner installation package. Be sure to select the correct Visual Studio add-in for your version of Visual Studio.

Once you install the basic IDE add-in, you can create a new VuGen script within Visual Studio. Alternatively, you can begin developing your script in VuGen. If, while developing a script in VuGen, you realize that you need to the capabilities of your native environment, the Open in Visual Studio or Open in Eclipse button opens the script in the respective application. This requires you to have first installed the basic Visual Studio IDE add-in. (For Eclipse, VuGen automatically installs the add-in the first time you choose Open in Eclipse). For details, see Debugging .NET Vuser Scripts or Edit and Run Scripts in Eclipse.

When working in Visual Studio or Eclipse, the complete VuGen API is available from the Object browser. For information about each of the Vuser functions that you can use when programming your script, see the Function Reference.

Back to top