Forum Discussion

ZkElga's avatar
ZkElga
New Contributor
4 months ago
Solved

Access current re-run iteration from script (javascript)

Hello, I have my project configured to re-run the test cases that failed, and now I need to find a way to know (via javascript) on which iteration of the "re-run" is the current test case running. E...
  • ZkElga's avatar
    4 months ago

    Well I found the property I was looking for, it can be accessed by calling Project.TestItems.Current.Iteration, it will return the number of the re-run iteration for each test case.

    ----

    For those who are so shocked by the idea of re-running a test case, if it wasn't necessary to "re-run/re-try" anything, then we wouldn't have "try-catch" in programming languages, and certaintly TestComplete or any other tool wouldn't have such feature implemented. Sure, if your tests are 2 clicks and a string validation, then a re-run is not needed; but when you work with multiple applications and a temporary server downtime can bring one app down for 20 seconds and later work fine, then yes, it's better to have a re-run that will make my test pass the second time, than whining about a 20 seconds downtime on a lower environment; and I can give countless examples of the "re-run" being a useful tool which doesn't compromise the overall results of the QA process and actually makes it even a useful tool for further analysis of the applications' stability.

    I don't understand why people feel the need to criticise other's work without even knowing why we're doing what we're doing.