Skip to main content

ASP.NET Virtual User

Web pages written using ASP.NET pose a challenge when trying to record and replay scripts for performance testing. In particular, ASP.NET uses hidden fields to transfer and persist data between the server and the client. Hidden fields are likely to be different for each test run, and must be correlated carefully so that the virtual users (VUs) send correct data back to the server each time.

The ASP.NET VU addresses these concerns by automatically parsing and handling hidden fields on ASP.NET web pages. ASP.NET VU is based on the C# Web VU, but comes with additional methods as described in the C# API.

The Web Script Generator is also extended so that when you generate an ASP.NET VU script from a recording, the generator adds calls to the methods ApplyAspNetHiddenFieldsToForm() and ClearAspNetHiddenFields() within the generated script. These handle the vast majority of the hidden fields automatically.

Creating Custom ASP.NET Virtual Users

Like other VU types, we recommended creating a custom VU as a child of the ASP.NET VU, so you can add your own functionality later if required.

To create a custom ASP.NET VU, perform the following steps:

  1. In Eggplant Performance Studio, display the Workspace tree and locate the ASP.NET C# Virtual User under Virtual Users > Web.

  2. Right-click ASP.NET C# Virtual User, and select New Virtual User. The Virtual User Specification dialog box opens, with the Parent and Namespace fields filled in as shown below.

    The ASP.NET Virtual User Specification dialog box

  3. Provide a name for your ASP.NET VU. The Class name fills in as you type the name and the Finish button becomes available.

  4. Click Finish when you finish entering your VU name.

Now you can create scripts based on your new custom ASP.NET VU.