简体   繁体   English

我们如何在空手道 API 中运行特定的 CSV 行(测试用例)

[英]How can we run specific CSV rows (Test Case) in Karate API

I have 10 data driven API test cases defined in CSV file in 10 rows and my feature file generates dynamic requests from data sheet and execute the test cases.我在 CSV 文件中定义了 10 行的 10 个数据驱动的 API 测试用例,我的功能文件从数据表生成动态请求并执行测试用例。 But I wanted to run only one Test case out of 10. Is there any way that I can trigger only one test case in Karate API?但我只想运行 10 个测试用例中的一个。有没有什么方法可以在空手道 API 中只触发一个测试用例?

Thanks in advance !提前致谢 !

No you can't do this for CSV files, sorry.不,您不能对 CSV 文件执行此操作,抱歉。 If you have a normal Examples table you can append the line-number of the row to the feature file like this:如果您有一个普通的Examples表,您可以 append 将行的行号添加到功能文件中,如下所示:

some.feature:15

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM