| || |
Is there any efficient to know which action iteration is failed in QTP?
I have ran into a situation where I am not able to find an efficient way to know which action iteration is failed during execution.
There are around 10 global test iterations and each test iteration got 3 action iterations to execute. How to find if one of the QTP action iterations is failed due to run time error.
i tried using Err.Number instead of Reporter.Runstatus as this cannot be reset if one of itrs is failed. But err.number is not seem to be reliable one. I wanted to know is there any other approach to find out which action iteration is failed during execution ?
Any help is greatly appreciated.
Thanks in Advance,
Last edited by saisanthosh1; 12-13-2012 at 08:51 PM.
How about using environment variables ActionIteration and ActionName. Use Reporter.ReportEvent micInfo, "Current Iteration: ", Environmnet("ActionIteration) ?
Thank you for the reply! Envrionment(TestIteration)/Env(ActionIteration) helps me to get only the current iteration number. but I am looking something if QTP proceeds to next action iteration upon the occurrence of run time error. Is there any way to extract the info/API call that a specific iteration is failed. I tried reading QTPresults.xml file while executing the test but it didn't help me much.
Reading Result.xml will be some kind of approach and it has to be done after execution only. Instead just have a Environment varibale of your own and update the status on the same. Implement as part of your framework. It will help you to customize in your way !!!
Thank/Like to help others if my input helped you !!!
I am speaking for myself, not for my employer nor any one. Automation Ecstasy
Thanks for your reply!. However i made a temporary fix like writing the status of an action iteration to a dictionary object at beginning of the iteration and check if the status has changed to 'Completed' or something, before proceeding to next action iteration.
I read about Setting("OnAbort") in tarun lalwani's book. According to the book, this setting is useful only if the script is stopped. In the QTPResults.xml file, if the one the iterations is failed the status indicates as 'Run stopped by the user' . Under this impression, i tried using this setting but it displays as 'False' even if the iteration is failed.