[英]Passing parameters while calling a scenario from another feature flie in karate?
I know how to call specific scenario from another feature file and pass parameters along.我知道如何从另一个功能文件调用特定场景并传递参数。 But is there a way I can do it while checking for condition using 'if'?
但是有没有办法在使用“if”检查条件时做到这一点? For instance:
例如:
* if (role=="SME"||role=="BA") karate.call('classpath:rough/utility.feature@checkDisabled'){element: #(elem)}
If this is the wrong implementation as what I get from the console.如果这是我从控制台得到的错误实现。 Please suggest me a way how can i achieve this in karate?
请建议我如何在空手道中实现这一目标?
Thanks谢谢
When you use karate.call()
put the second argument inside the round brackets.当您使用
karate.call()
将第二个参数放在圆括号内。 This is pure JS and "Karate-style" embedded expressions will not work.这是纯 JS 和“空手道风格”嵌入式表达式将不起作用。
* if (role=="SME"||role=="BA") karate.call('classpath:rough/utility.feature@checkDisabled', {element: elem})
Please take some time to read this part of the docs: https://github.com/karatelabs/karate#call-vs-read请花一些时间阅读这部分文档: https : //github.com/karatelabs/karate#call-vs-read
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.