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:

WebTestPlugin.PreRequest

WebTestRequestPlugin.PreRequest

ExtractionRule.Extract

ValidationRule.Validate

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

ResultsSequence

 

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.

Ed.

Comments

  • Anonymous
    August 29, 2008
    The comment has been removed

  • Anonymous
    August 31, 2008
    Vous vous êtes déjà demandé quel était le cycle de vie d’un test web ? Par exemple : Quand étaient bindées

  • Anonymous
    January 15, 2009
    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

  • Anonymous
    June 01, 2010
    Merci mec !! Thanks a lot for this schema. It is missing in MSDN.

  • Anonymous
    September 19, 2014
    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