Forum Discussion
anagpal
Occasional 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
avidCoder
6 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
Recent Discussions
- 4 days agominhng