12
Views
1
Comments
Solved
How to handle exception in BDD TestFramework.
Question

Hello,

one of my server action raises exception on giving invalid input parameters, how to handle it in BDD,

as it is showing no items to show.

Thanks in Advance!!

Solution

Hi RAM,

  1. You have an action that throws an exception when when invalid parameters are provided;
  2. You wanna test that your action is indeed throwing the correct exception.

If that is the case what you can do is adding an exception handler to your when action. In the exception handler you save the exception message into a variable.


On your then action you can the assert the error message.