Forum Discussion
avidCoder
Super Contributor
Hey, you need to add this code where erver you are trying to do assertion.
And also if you are using Ready API tool use, log.info to print anything.
anagpal
6 years agoOccasional Contributor
I tried in JSONPath Asertion: Here in example, API Response - $['availableIncome'] = 1420.0
And in Expected result, I am checking the value from my excel (test Data expected output = 1420)
In expected result i added:
def data = ${TestData-StandardLoan#Output_AvailableIncome} def newData = new Double(data).round(2)
printf("${newData}")
But it doen't work
- avidCoder6 years agoSuper Contributor
See, I don't have readyAPI installed in my system. Inside assertion, you need to use assert method.
def data = ${TestData-StandardLoan#Output_AvailableIncome} def newData = new Double(data).round(2) assert $['availableIncome'] == newData
I thought you were using groovy script, that is why i gave you code snippet to verify using contains or equal method.
Related Content
- 8 years agovarma18
Recent Discussions
- 13 hours agodipsthorat
- 17 hours agoisbiat
- 21 hours agoLea
- 2 days agoarmygrad