Debug .NET Vuser scripts

You can compile a .NET Vuser script to check its syntax, without running the script. To compile the script directly from VuGen, press Shift+F5 or select Vuser > Compile. If VuGen detects a compilation error, it displays the error in the Output window. Double-click on the error to go to the problematic line in the script.

To run the script directly from VuGen, press F5 or select Replay > Run. Breakpoints and step-by-step replay are not supported in VuGen's editor window for .NET Vusers. To debug a script and run it with breakpoints or step-by-step, run it from within Visual Studio .NET as described below.

Viewing scripts in Visual Studio

Visual Studio provides you with additional tools to view, edit, and debug your Vuser scripts. You can add breakpoints, view variable values, add assembly references, and edit the script using Visual Studio's IntelliSense. You can also run the script in a step-by-step mode for debugging.

When you save your script, VuGen creates a Visual Studio solution file, Script.sln, in your script's folder. You can open the solution file in Visual Studio .NET and view all of its components in the Solution Explorer.

To open the Vuser script in Visual Studio, select Design > Open Script in Visual Studio or click the Visual Studio button on the VuGen toolbar.

Note: By default, the Vuser script opens in the latest version of Visual Studio that is installed on your computer. For example, if you have both Visual Studio 2017 and 2019 installed, the script is converted and opened in Visual Studio 2019.

Double-click the appropriate section in the Solution Explorer, such as vuser_init.cs, to view the contents of the script.

Note: VuGen automatically loads all of the necessary references that were required during recording. You can add additional references for use during compilation and replay through the Solution Explorer. Select the Reference node and select Add Reference from the right-click menu.

Click on globals.cs or globals.vb in the Solution Explorer to view a list of the variables defined and used by your script.

Back to top