To create a component, implement the StresStimulus.Extensibility.IExternalComponent2 interface:

  • OnTestStart(): Use this method initialize any test specific objects that will be used during the test, or to run any pre-test script (such as cleaning previously created database records).
  • OnBeforeIteration(): This is called before an iteration starts. It receives an instance of RuntimeVU object to read the VU properties.
  • OnRequestInitialize(): This is called before a request is composed.
  • OnBeforeRequest(): This is called before a request is sent. It receives an instance of RuntimeSession object that can be used to customize the request headers and body. This method is called after all parameters have been applied to the request.
  • OnBeforeResponse(): This is called after a response is received but before it can be processed by StresStimulus. It receives an instance of RuntimeSession object to read the response headers and body for further automation. This is new to StresStimulus v5.3.
  • OnAfterResponse(): This is called after a response is received. It receives an instance of RuntimeSession object to read the response headers and body for further automation.
  • OnAfterIteration(): This is called after an iteration is complete. It receives an instance of RuntimeVU object to read the VU properties.
  • OnTestEnd(): Use this method to clean up any objects used during the test or run any post-test script.
  • InvokeForAllSessions: (new to StresStimulus v5.3) If returns true then OnRequestInitialize, OnBeforeRequest, OnBeforeResponse, OnAfterResponse will be fired for all session objects in the test case. If returns false then those methods will only be fired for only those session objects that set the Component Hook property to the Component name.


See the following section for further component API Reference.

  • No labels