[英]How to set value in CSV file in Karate
I am reading some test userid and password from csv file.我正在从 csv 文件中读取一些测试用户名和密码。 and want to store id(combination of id and password and some random text) for each userid and password using karate.并希望使用空手道为每个用户 ID 和密码存储 ID(ID 和密码的组合以及一些随机文本)。
Feature: setid特征:setid
Scenario Outline: set authid场景大纲:set authid
* def authId = '<username>' + '<password>' + 'test'
* print authId
* set <id> = authId
Examples:
| read('testdata.csv') |
testdata.csv测试数据.csv
username,password,id用户名、密码、id
shivam,abc,希瓦姆,ABC,
rahul,pqr,拉胡尔,pqr,
While running above code i am getting error datatest.feature:5 - no step-definition method match found for: set = authId运行上面的代码时,我收到错误 datatest.feature:5 - no step-definition method match found for: set = authId
Can anyone help me where i am missing.任何人都可以在我失踪的地方帮助我。
Sorry you can't update a CSV data source like that.抱歉,您无法像这样更新 CSV 数据源。 Please use Java code, as what you seem to be trying to do is something specific and not normal API testing related.请使用 Java 代码,因为您似乎正在尝试做一些特定的而不是正常的 API 测试相关的事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.