问题
actual value is not a string error
Getting an error while performing an assertion
field1 = [1850, 700, 30] field2 = ["1850.0","30.0","700.0"]
Error- assertion failed: path: $, actual: [1850, 700, 30], expected: '["1850.0","30.0","700.0"]', reason: actual value is not a string
回答1:
Yes, because it is not a string. This will work:
* def field1 = [1850, 700, 30]
* def field2 = ["1850.0","30.0","700.0"]
* def field3 = karate.map(field2, function(x){ return ~~x })
* match field1 contains only field3
Please see this other answer also: https://stackoverflow.com/a/57761131/143475
来源:https://stackoverflow.com/questions/57780903/error-actual-value-is-not-a-string-while-performing-assertion-in-karate