vadivelu
vadivelu

Reputation: 142

how to call parameterized function in config .js file at feature file using karate framework?

I need to pass response value from feature file to javascript function which is defined at config.js file for some computation purposes . Please help on how to call function which is present at config.js file?

Upvotes: 1

Views: 1296

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58078

First refer to this: https://github.com/intuit/karate#javascript-functions

Just keep the JS as a *.js file and re-use it from any feature or the karate-config.js. Note that karate.call() is possible from JS, including karate-config.js and you can even call a feature file, not just JS.

Maybe you should also look at the example for karate.callSingle() which is new in 0.7.0. As of the time of this post, version 0.7.0.RC5 is available to test.

Upvotes: 2

Related Questions