如何在空手道中的单个功能文件中使用两个或多个csv文件? [英] How to use two or more csv file in a single feature file in karate?
本文介绍了如何在空手道中的单个功能文件中使用两个或多个csv文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在考虑在单个功能文件中使用两个csv文件,但不能这样做,而是共享相同的演示代码:
I am thinking of using two csv files in a single feature file, but unable to do so, sharing a demo code for the same:
Scenario Outline:
* driver 'https://github.com/login'
* input('#login_field', '<username>')
* input('#password', '<password>')
* submit().click("input[name=commit]")
* match html('#js-flash-container') contains 'Incorrect username or password.'
Examples:
|read('one.csv')|
|read('two.csv')|
在这里,<username>
存储在one.csv中,而<password>
存储在two.csv中,有没有办法做到这一点?请帮忙.预先感谢.
Here, <username>
is stored in one.csv and <password>
is stored in two.csv, is there a way we can do this? Please help. Thanks in advance.
推荐答案
没有空手道永远不会支持此功能.但是请注意,您可以在Background
中创建数据源.
No Karate will never support this. But please note that you can create the data-source in the Background
.
Background:
* def one = read('one.csv')
* def two = read('two.csv')
* def data = karate.append(one, two)
Scenario Outline:
* print __row
Examples:
| data |
这篇关于如何在空手道中的单个功能文件中使用两个或多个csv文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文