AnsweredAssumed Answered

Scripted assertion to control the flow based on status value

Question asked by rajeswari.krishnan on Aug 29, 2017
Latest reply on Sep 1, 2017 by rajeswari.krishnan

 

# monika mehta

 

Response : {"deviceStatus":"InEligible","deviceStatusMessage":{"message":"Instore Pickup order has already been placed for this d

 

Scripted assertion

if(testExec.getStateValue("deviceStatus").equals("Eligible"))
return true;
else if(testExec.getStateValue("deviceStatus").equals("InEligible"))
return false;

 

I have used a json filter and the property variable is deviceStatus from the above response If its eligible i need to go to next step , else not

 

But i am getting error as shown below. Pls help to get rid of this error.

 

The assertion of type "Assert by Script Execution" had outcome:
Script, // This script should return a boolean result indicating the assertion is true or false
if(testExec.getStateValue("deviceStatus").equals("Eligible"))
return true;
else if(testExec.getStateValue("deviceStatus").equals("InEligible"))
return false;
execution error so we assume false: java.lang.IllegalArgumentException: key can not be empty

 

Outcomes