I use Reporter.RunStatus to log failure and just found out if I run 10 test cases and one of them failed, the micFail keeps to the end of the test.
How can I turn it back to micPass, just like "Err.Clear" after logging the failure, or I have to find another way to check the status.
You can't. It is a ready only status of the current running test. So if any action or any code reported a failure then this status will remain micFail for the whole test run
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **
Good to know that we can use Reporter.RunStatus only once. So I have to use other ways to check the verification results for each test iteration.
I tried Last Error object and it turned out that while Reporter.RunStatus was micFail, Last Error returned "the operation reran seccessfully".
Any suggestions on what I can try?
Will a failure from QTP run, say due to some checkpoint issues throw a corresponding err description through the Err object?
If the failure is due to some run errors, then you may get the Error number and description.
You would have to do your custom reporting and avoid depending on reporter.runstatus approach.
-- Here to Learn and share ---
This is what I did to replace check on Reporter.RunStatus
bolPass1 = Browser(xx).Page(xx).WebElement(xx1).CheckProperty "xx", "xx"
bolPass2 = Browser(xx).Page(xx).WebElement(xx2).CheckProperty "xx", "xx"
bolPass3 = Browser(xx).Page(xx).WebElement(xx3).CheckProperty "xx", "xx"
If Not (bolPass1 And bolPass2 And bolPass3) Then
It works well.