so my code is as follows:
* def value = newMP.response.data[randomizer].phoneNumber
* def nullvalue = 'null'
* def filter = (value == '#null' ? nullvalue : value)
* print filter
And param filter[phoneNumber] = filter
The result of this code is
Thing is that my application allows a search for null as well. therefore im looking if its possible to put in a filter that is null based on the conditional logic
Additionally if i go like this
And param filter[phoneNumber] = 'null'
the null value is in the GET call
Yes by default Karate ignores null-valued params and this is what most users expect.
You have not been clear as to what you are expecting but I'm guessing you need a param with an empty value.
Try this:
And param filter = ''
Also read this example for more ideas: https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/search/dynamic-params.feature
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With