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

微笑、不失礼 提交于 2021-02-05 09:11:27

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/48378493/how-to-call-parameterized-function-in-config-js-file-at-feature-file-using-kara

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!