Code a .NET script

You can create an empty .NET or .NET+ Vuser script, in which to place .NET code. This script type lets you incorporate your existing .NET application into VuGen. To create an empty .NET Vuser script, select .NET or .NET+, as applicable, in the Create a New Script dialog box.

In a .NET Vuser script the default language is C#.

If your script is generated from a recorded session, VuGen enables you to change the script language from C# to VB.NET by selecting Visual Basic .NET Language from Record > Recording Options > General > Script and regenerating the script.

Tip: You can edit the script in Visual Studio by clicking the button on the toolbar.

The following example shows the Action section of an empty .NET script:

			namespace Script
			  public partial class VuserClass
		 	    public int Action()
			  // Add your code here
			  return 0;

Note: Enter the business process code in the Action method. Add initialization code to the vuser_init method, and cleanup code to the vuser_end method.

Back to top

See also: