Forum Discussion

anagpal's avatar
anagpal
Occasional Contributor
7 years ago

JSON Path Match Assertion - To compare the decimal values (.0)

Hi, I am using the JSON Path Match Assertion to match the response value with my excel (Data Driven). I am using data driven (Data Source excel) having all Inputs and Outputs (expected result). Now in API response i want o compare the Value with my Excel value.(Expected output) Problem is, say in response value is 1344.0 but in excel value is 1344 so it fails (snapshot attached). So please help how to handle it in assertion (Asset for content > JSON Path Expression) editor so that it compare the response value 1344.0 (or 134.00) with excel value 1344 and pass it
  • Hi anagpal,

     

     

    I think doing this in JSON path Match assertion is not possible, to achieve this you can write your own custom groovy code in script assertion. If you need help in that let me know.