Forum Discussion

abhayguna's avatar
abhayguna
Occasional Contributor
10 years ago

How to validate a REST request, ideally which should not return anything?

Hi,

 

I am validating a REST request. For my scenario, ideally, the REST request should not return anything. Any how i am not getting any response.

But after 2 mins of "Socket timeout" test case is getting failed. How can i validate this negative scenario?

 

I would like to use an assertion to validate the request, which should not return anything.


Thank you in advance

 

4 Replies

    • abhayguna's avatar
      abhayguna
      Occasional Contributor

      Hi Rao,

       

      Thank you for your resonse. I would like to write an assertion, that should PASS when the request does not reply anything. Means, after Socket time out, my test case should pass.

       

      Actually i am testing a negative scenario, in which, if there is no data in DB, My request returns nothing.

       

       

      Thank you,

       

      • nmrao's avatar
        nmrao
        Community Hero
        Ok, but how would the caller know that there is no value, should n't receive a response saying something like the requested data / information could not be found etc?