问题
My scenario is to check whether a field accepts range from 0.01 to 25000 .. it can be decimal value . What is way to do it in karate framework.. I used below regex which is not correct
regex [.0-9]*
回答1:
Just multiply by 1 to convert a string to a number
* def foo = '0.2'
* assert (foo * 1) < 0.3
Also please read: https://github.com/intuit/karate#type-conversion
来源:https://stackoverflow.com/questions/58630846/validate-the-float-value-range-in-karate-framework