I have a function which compares 2 array values. As soon as a mismatch value is found the execution stops , but i want to only when all comparison have been done and if error has been found. There is OnLogError in testcomplete but do not know how to use it
function compare() {
for (var i = 0; i < arrActualIntendedVal.length; i++) {
if (val1[i] != val2[i]) {
Log.Error("Value " + val1[intArrIndex] + " do not match to Actual Value " +
val2[intArrIndex]);
Runner.Stop(0);
}
}
return true;
}
You just need to "remember" that there was an error and post the corresponding info after your loop is finished.