Random Variables

You can define random variables for your test user that can be accessed within .NET test code. There is a wizard in Visual Studio .NET that helps you define these random variables. The wizard has the same look & feel as the random variable wizard of Silk Performer.

Depending on the type of random variable you choose, the wizard adds the appropriate random custom attribute to the virtual user class. You can use the following random custom attributes:
  • RndBin
  • RndExpF
  • RndFile
  • RndInd
  • RndPerN
  • RndSno
  • RndStr
  • RndStream
  • RndUniF
  • RndUniN

The first parameter is the name of the random variable. This is followed by the parameters that must be defined in BDL to define the random variable. For additional information, refer to the Benchmark Description Language (BDL) Reference or check Visual Studio .NET's Code Completion.

You can access random variables with the following three new functions that are declared in the BDL class as static methods:
  • GetRandomFloat
  • GetRandomNumber
  • GetRandomString
Those methods take the name of the random variable as an input parameter and then return random values.