Forum Discussion

ilovechiku's avatar
ilovechiku
Contributor
9 years ago

Assertion for delete responses.

I have a delete request which doesnt return anything in reponse. Sucessful deletion gives me a 204 status code and deletes the row from the table. 

 I would like to assert from the response that on successfully deletion i dont see the row in the table.

 

my request looks like this:

{
"CompanyId":"1",
"RoleName":"CopyofHr",
"ActionTakenBy":3144
}

 

In a groovy step i get these  3 values from the Database.which i have parameterized to get  top 1 values from DB.  All these three fields are coming from table called roles. On deletion a row is deleted from role.

How can i do a assertion that the row is actually deleted.

 

 

 

please help.

 

12 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Not sure I completely understand the question.

    1. Do you want to assert on the delete request i.e., based on response code?
    2. Do you want to assert using jdbc result?
    3. Like to do both?

    Please clarify.
    • ilovechiku's avatar
      ilovechiku
      Contributor

       

      Yes I would like to -. Do you want to assert on the delete request i.e., based on response code? 

       

       

      Also would like to know  if this is possible in PRO version

      Can you use property transfer for assertions as well? I want to assert on a delete testcase. the delete reponse is empty. However,on successful deletion the row is deleted from the table. I have captured the primary key of the deleted row in a scripted Groovy step (star step )above the testcase. How can i transfer this property (primary key of row that was deleted) to reponse?

       

      • nmrao's avatar
        nmrao
        Champion Level 3
        May be you can go one by one.
        Let us deal with first question, can you post the raw response?
        Do you have license for PRO or just evaluating?