Forum Discussion
yes.. got your issue.. In this case, You should go for second approach:-
def data = 176.98 log.info new Double(data).round(2) assert new Double(result).round(2)==176.98
Whatever column name (Output_loanTerm) data you want to fetch for assertion.
Read that column data using Java/Groovy code and convert it into double value rounded upto 2 digit.
If you want all the column data to be changed use for loop and implement the same.
Hi avidCode,
Thnaks for your reply. I am little bit confuser here, i tried but assetion is always pass even for wrong values as well.
I need youe help to create the assetion: (we are using JSON as API request/response)
Scenarios: DataSource Testing
In Excel I have inputs as well ouputs, for one of scenario My excel (DataSource) output is :
( '${DataSource#Output_LoanTerm}' ) --> Value is 45
Now when i used Data Source for executing my test case API returns:
$['LoanTerm'] --> Value is 45.0
I want to match ( '${DataSource#Output_LoanTerm}' ) = $['LoanTerm']
(45 = 45.0)
Assertion failed, (due to .0). I tried the Assertion using Groovy script but no luck (may be i have no experience of Groovy Script). Can you please send me an example with above case.
Or can we use the JSONPath Asseretion for contect match as well, If yes please help, sorry as i have no knowledge of JSON :)
Related Content
- 8 years agovarma18