I have an API, wherein the Param field, I need to pass the current date as a string.
And param filter = 'ORDER_DATE:"2021-01-31"'
I am trying to pass the current date for the ORDER_DATE field form a java method:
* def todaysDate = helper.getTodaysDate()
And print todaysDate // Prints 2021-02-04
Now I need to pass this "todaysDate " valuein the param filter field.
Following what I have tried so far:
And param filter = 'ORDER_DATE:#(todaysDate )'
And param filter = 'ORDER_DATE:<todaysDate>'
From example table value.
In Both cases, it printed "todaysDate " instead of its value "2021-02-04"
question from:
https://stackoverflow.com/questions/66050838/how-to-add-a-dynamic-variable-value-inside-a-param-field-as-a-string-in-karate 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…