javascript - onlogerror event in testcomplete -
i have function compares 2 array values. mismatch value found execution stops , want when comparison have been done , if error has been found. there onlogerror in testcomplete not know how use it
function compare() { (var = 0; < arractualintendedval.length; i++) { if (val1[i] != val2[i]) { log.error("value " + val1[intarrindex] + " not match actual value " + val2[intarrindex]); runner.stop(0); } } return true; }
you need "remember" there error , post corresponding info after loop finished.
function compare() { var errors = new array(); (var = 0; < arractualintendedval.length; i++) { if (val1[i] != val2[i]) { errors.push("value " + val1[intarrindex] + " not match actual value " + val2[intarrindex]); } } if (errors.length > 0) { log.error("error when comparing arrays", errors.join("\r\n")); runner.stop(); } return true; }
Comments
Post a Comment