空手道自动化的功能文件中如何调用python文件? [英] How to call python file in a feature file of karate automation?

查看:56
本文介绍了空手道自动化的功能文件中如何调用python文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要调用.py文件并将参数传递给其中的一个函数,并且必须匹配返回的结果.

I need to call a .py file and pass an argument to one of the functions in it and have to match the result returned.

例如:xyz.py

KarateXyz.feature

KarateXyz.feature

  • 匹配结果== call('xyz.py')#如何指定方法名称并在其中传递参数?

推荐答案

是的,您可以使用 karate.exec()调用任何OS进程.是否安装python取决于您.请参考 https://github.com/intuit/karate#karate-exec

Yes, you can use karate.exec() to call any OS process. Whether python is installed is up to you. Refer https://github.com/intuit/karate#karate-exec

* def result = karate.exec('python foo.py bar')

有关更多详细信息,请参见: https://stackoverflow.com/a/64352676/143475

For more details, refer: https://stackoverflow.com/a/64352676/143475

这篇关于空手道自动化的功能文件中如何调用python文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆