AnsweredAssumed Answered

How to terminate and fail the execution on custom failures

Question asked by Gopinath hariharan on Mar 9, 2016
Latest reply on Mar 9, 2016 by Gopinath hariharan

i have  a array validation to be made. Once my array validation fails i want the touch test to stop the execution and fail the test. 


i validate using the below method but on failure touchtest doesnt fail the test. instead it passes the test with the custom message we give. 


function arraysAreIdentical(arr1, arr2){
if (arr1.length !== arr2.length) return false;
for (var i = 0, len = arr1.length; i < len; i++){
if ((arr1[i]).trim() !== (arr2[i]).trim()){

$context.result.postMessage($context.result.LEVEL_INFO,"ARRAYS DO NOT MATCH");
return false;

$context.result.postMessage($context.result.LEVEL_INFO,"ARRAYS MATCH");

context.currentClip.end("TEST STEP Failed "+ customMessage);
return true;