Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

You can further extend StresStimulus run-time by creating an external component.  An external component traps StresStimulus run-time events to extend its functionality. Components can be created by writing .NET code. Once created, they are displayed in the Component section of the workflow tree (a). 

To create a component inside StresStimulus, navigate to the Components tab (a). From there, you can create your own variable. Select one of three languages you wish to use: C#, VB.NET or JScript.NET (b).



Give your variable a name (1) and chose when you want to evaluate it (2). StresStimulus will either evaluate the variable once per VU-iteration on the first use or every use. Then the script editor will open, and you can write your code, compile it and save it.



You can edit or delete your variable later on by going back to the Scriptable Var tab, selecting the variable you wish to modify, and then clicking either Edit (c) or Delete (d). Click OK to bring up the code editor window.



StresStimulus evaluates the scriptable variable before sending the request that has the parameter where the variable is used ("related request"). At this moment, your custom code is executed; the return value is assigned to the variable and is used to parameterize the request.


There are two modes of evaluation the scriptable variable: on request and iteration:


  • On request: the evaluation event takes place before issuing every related request, in every iteration for every VU. Use this evaluation mode only when the variable value is expected to change on every occurrence of your code execution. 


  • On iteration: the evaluation event takes place once per VU-iteration before issuing the first related request. After that, the scriptable variable value is stored in StresStimulus and is re-used within the same iteration in any subsequent related requests, if they exist. Use this mode if the value of the scriptable variable must stay the same for the duration of the VU-iteration.


There are two types of scriptable variables that differ by the method they are created:

  • Internal scriptable variables are created in StresStimulus. Their benefit is simplicity as they do not require any additional development tools.
  • External scriptable variables are created by developing external .NET DLLs using Microsoft Visual Studio. This allows to develop more sophisticated functionality and behavior using external libraries and powerful development and debugging Visual Studio environment

Creating scriptable variables

To create a scriptable variable inside StresStimulus, navigate to the Scriptable Var tab (a). From there, you can create your own variable. Select one of three languages you wish to use: C#, VB.NET or JScript.NET (b).



Give your variable a name (1) and chose when you want to evaluate it (2). StresStimulus will either evaluate the variable once per VU-iteration on the first use or every use. Then the script editor will open, and you can write your code, compile it and save it.



You can edit or delete your variable later on by going back to the Scriptable Var tab, selecting the variable you wish to modify, and then clicking either Edit (c) or Delete (d). Click OK to bring up the code editor window.

  • No labels