Problem:
How can I exclude timers from results if an error has occurred within the code being timed?
Resolution:
ANSWER
----------------------------------
You may, for example, want to exclude timers for web page timers if verification errors or HTTP 500s occur. To do this you need to use the MeasureStart & MeasureStop functions. The MeasureStop function includes an additional Boolean parameter which when enabled the measured time is included in calculations only if no error has occurred since the timer started. This is an optional parameter and the default value is false.
The following code shows the option enabled:
MeasureStart("TimeMeasure");//This verification will fail as Mountan does not exist in the GMO pageWebVerifyHtml("Mountan",1, WEB_FLAG_EQUAL, NULL, SEVERITY_ERROR); WebPageUrl("http://gmo.demo.com");//remove the default page timer from WebPageUrl and use the custom timers insteadMeasureStop("TimeMeasure",true);// enable the boolean param
Old KB# 17621