Is there a way/how to verify api response directly as a step in an UI test case?

For example, if we create a test case and use regular UI fill and click to login a user, is there a way/how we can create some test step to verify from the login API response, and confirm the response json object has a filed called "id" that is not on display from frontend UI

1 comment
Joseph Hamdan

Hi Dhrupa,

You can use Verify_Rest command to achieve this. You can create a REST Connection with the API information and the Field Key text box can be used to enter the field 'id'. You can use any of the operators in the dropdown list and the text box next to Field Key can be used to enter a value for comparison/verification.

Alternatively, you can use Get_REST_Value command which will allow you to retrieve a value based on the operators shown in the dropdown below. The Keys/Xpath field can be used to enter 'id' from your JSON response. Once the value is retrieved and if you would like to a comparison, you can use Compare command.

Please let us know if you have any other questions. Command Reference page is below:

Subject7 Team

Comment actions Permalink

Please sign in to leave a comment.