Forum Discussion

Jason_S's avatar
Occasional Contributor
6 years ago

Failing assertion, can't understand why or how to fix it?!

I am placing assertions against a JSON response, by right clicking the response and "Add Assertion > for Content"


Initially the assertion passes as expected. But items I created on Friday are failing on Monday. I've looked a dozen times and the fact is the response is 100% identical to to the expected assertion value. I've even used BeyondCompare to verify as well as Notepad++ to verify the text, carriage returns and line feeds are exactly the same. I don't understand how this can initially pass then not pass when the value returned as not changed.


I can't post the actual value due to complaince and security reasons so I will post an example response in hopes that this can be understood. The response is as follows (Note the CR/LF after Name):

SSN / ITIN: xxx-xx-xxxx
dba Example Company Name



5 Replies

  • Hi Jason_S,


    If you think that this response will never get changed, try adding contains assertion manually from the Bottom Assertion TAB and writing your expected over there.


    Do Like and Accept if you find it as Solution.



    Himanshu Tayal

    • Jason_S's avatar
      Occasional Contributor

      I thought about that, but to be honest I really don't feel that's the appropriate answer.


      In our business validating exact information is pretty crucial and I think using a contains would allow for additional information to technically pass. This information is likely to not change, but I cannot say with 100% certainty that it will never change. I would really like to understand why this is failing so that I, or someone, can correct this issue.

  • Aslam's avatar
    Regular Visitor

    I have exact same situation as Jason and would like to understand why it happens and is there any way to fix this problem.