AnsweredAssumed Answered

Scripted Assertion

Question asked by MohammedShahid on Nov 18, 2015
Latest reply on Nov 18, 2015 by SuryaAnilKumar

Hi ,

I have scripted Assertion in my Output log message . Iam automating Restful webservice application  using Data driven framework.

I need to make Test case execution Pass or Fail based on scripted assertion given below-

if("{{ResponseMsg2}}" == ("{{Expected_Result}}"))

testExec.setStateValue("Result","Pass");

}

else

testExec.setStateValue("Result","Fail");

}

return true;

 

The property {{ResponseMsg2}} is the filter(Parse Text from xml) from Resful response.

{{Expected_Result}} is the property from Dataset .Expected_Result is the column name in my Input sheet(Read rows from Excel).Iam comparing the Expected Result column with one of my response tag in Resful service . Based on this, i need to make testcase pass or Fail and write it to Delimited file.But the above code doesn't work. It shows

execution error so we assume false: java.lang.IllegalArgumentException: key can not be empty.

The same script  i used for Insert and update Restful services , it works fine  and i can able to write to Delimited file using the {{Result}} property

and when i checked  in Test Events tab, it is showing something like

Workflow given continue step, so workflow will not change.

Plz  help.

Outcomes