Get to know the last operation status in script
Hi All,
I need to know the status of the last operation performed in script to report to third party such as
was that last click operation was sucessful or had failed ?
was that last set operation was sucessful or had failed ?
Is there any way i can read the logs for last step as in logs we get status of each step.
I tried Project.Logs but does not give me info about the last step
set logitem = Project.Logs.LogItem(Project.Logs.LogItemsCount-1)
set data = logitem.data(logitem.DataCount-1)
status= logitem.Status
Please suggest if we have any way.
Thanks,
Bharat Sethi
Project.Logs only gives you a collection of top level items in the log. If what you are looking for is not at the top level (Keyword Test, Test Item, Script, etc), that's not going to work for you.
Question: How are you writing out the status in the first place? Are you just using what TestComplete automatically records or are you writing your own log message for pass/fail on the last operation? My suggestion would be to do the latter... update your tests/scripts, in such a way that you write out pass/fail results to some sort of storage (in memory variable, external file, database, etc) that you can then mine for the necessary data.
The other possibility would be to leverage the OnLogEvent message since that fires for each Keys, Click, or SetText call. I think you can then use that as a jumping off point to find the necessary status.