18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

How to check values inside Response

amol.likhiteamol.likhite Members
edited December 2009 in Sahi - Open Source
Hi,

How to check values inside Response?

I am getting the response in form of JSON Objects. I have to check the values inside my objects and accordingly need to throw the exceptions.

Amol

Comments

  • narayannarayan Administrators
    Amol,

    I am not sure what this response is or how you are getting its contents.

    If you already have a JSON string, you can do this:
    var $obj = eval( "(" + $jsonStr + ")" ); // Standard way of evaling a JSON string
    _assertEqual("myExpectedValue", $obj.myProperty);
    
  • Hi Narayan,

    The solution is perfect.
    Thanks for the help.

    Amol
This discussion has been closed.