Assertion has failed

Hello guys,
I compare two arrays to each other, but for some reason assertion fails.
As shown on the image, values are same, but assertion has failed.


Could you please share the full error log and your full script. I have experienced the same thing before.

1 Like

in theory your code is right, buut …
groovy is sometime tricky with collection.
myListApi seems to be a list, and the other one a list of lists. so extracting the element 0 from it may looks like the right way.
but … the type of them may be different.

you will have to dig a bit, put some prints in your code to show the type and value of each variables subject to compare. i bet on type mismatch (but i could be wrong)


you can try also the opposite approach, assert that myPaidInterrest contains myListApi

You were right, the problem was in value types. I was comparing double to string, so now I’ve converted everything into string and now it works fine. Thanks.