Event ordering in Web Tests

Web tests have a number of extensibility points before and after a request. What order do they run in?

The hooks are:





Here is a sequence diagram that shows what order things fire:



There is no guaranteed order of firing for WebTestPlugin.PreRequest and RequestPlugin.PreRequest. Also if you have >1 Extraction or Validation rule on a request there is no guaranteed order they are run in.

Also note that Pre and Post request events do not fire by default for dependents. You can hook the PostRequest call on a top level request and iterate through dependents to wire up event handlers if you need that functionality.


Comments (5)

  1. Willy-Peter Schaub on TFS 2008 Service Pack 1 – Caution with database backups! Jason Barile on Why "Get…

  2. Vous vous êtes déjà demandé quel était le cycle de vie d’un test web ? Par exemple : Quand étaient bindées

  3. jborneman says:

    Thanks for the great chart. Question on the StartRequest/RequestComplete loop in there.

    What is it about % Time in Rules that the higher the time spent in rules (we have a number of regular expression extraction rules) that would cause the average response time for requests to be higher as that % goes up? Is it slowing down the rig so timestamp gathering or StartRequestReturn/SendRepsonseChunk are being delayed?

    It doesn’t look to me like pre or post request extraction rules are inside of the request loop, so why would time spent in those rules make response time longer?

    Thanks for your feedback

  4. Softlion says:

    Merci mec !!

    Thanks a lot for this schema. It is missing in MSDN.

  5. Ian M says:

    Hi there. This is quite an old post now so I'm hedging my bets a little asking a question this late on. I have a WebRequestTest set up that sends a SOAP message to a webservice. Before the request is sent there are a couple of WebRequestTestPlugins that are fired before the test – the first clears an Oracle DB and populates it with known data which is loaded into a Context Param for the request. The second plugin dll kicks off some real time background load. Then after that the request is sent. The problem I have is that I have code to stop the background load however the stop is being generated before the Webservice request is sent – I am using the PostRequest hook which I thought would fire after the response is received. This is a little confusing