简体   繁体   English

如何在空手道的 CSV 文件中设置值

[英]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.

相关问题 空手道 - 能够对 csv 文件中的特定数据集执行测试 - Karate - Ability to execute tests on a specific set of data in a csv file 如何在空手道特征文件中传递体型? - how to pass body type in Karate feature file? 使用 karate.fork 时如何获得特定值? - How to get a particular value when using karate.fork? 无法识别在 csv 文件中存储和使用的用于空手道场景的 json 请求正文的正确格式 - Cannot identify proper format for a json request body stored and used in csv file for use in a karate scenario 我们如何在空手道 API 中运行特定的 CSV 行(测试用例) - How can we run specific CSV rows (Test Case) in Karate API 无法在空手道功能文件中找到或读取文件 - could not find or read file in karate feature file 空手道 Api 测试 - 如何将数据从一个特征文件传递到另一个特征文件 - Karate Api Testing - How to pass data from one feature file to another 如何将从响应接收的值设置为.js或json文件 - How to set the value received from the response to .js or json file 从python中的csv文件获取唯一值 - Getting a unique value from csv file in python 空手道 - karate.configure('headers', { Accept: 'application/json' }); 在 karate-config.js 文件中无法识别。 它说缺少导入语句 - Karate - karate.configure('headers', { Accept: 'application/json' }); is not recognized in karate-config.js file. It says missing import statements
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM