Forum Discussion
Hi Andrei,
You can declare a global array which will store the failed routine calls and a global integer variable which will store the current number of failed routines. In the last test item, you will need to check whether the number is greater than zero. If it is, you will need to call the eval function to call the failed routines again. For example:
var a = new Array();
var totalFailed = 0;
...
function LastTestItem() {
var ErrCount = Log.ErrCount;
...
// Your test's code
...
// If the execution log contains errors, save the routine call
if (Log.ErrCount > ErrCount) {
a[totalFailed] = "Test();"
totalFailed++
}
// Check whether there were errors
if (totalFailed > 0) {
for (var i = 0; i < totalFailed; i++) {
eval(a); // Call each of the failed routines
}
}
}