![](/img/trans.png)
[英]Karate Api Testing - How to pass data from one feature file to another
[英]how to pass body type in Karate feature file?
我是 api 自动化和空手道框架的新人,我被要求使用 Body Type = 'x-www-form-urlencoded' 和其他参数(由于安全限制无法共享)自动执行 GET 请求,我尝试了以下选项,但收到一条错误消息,指出“找不到步骤定义方法匹配:Body Content-Type = 'application/x-www-form-urlencoded;charset=utf-8'
以下是我尝试过的 .Feature 文件内容:
**Feature: First demo API
Scenario: API demo try
Given url '{Given_url}'
And Body Content-Type = 'application/x-www-form-urlencoded;charset=utf-8'
And Body {Grant_type:Value, scope:value}
when method GET
Then status 200**
我什至尝试将 Body Type 传递为 'x-www-form-urlencoded;charset' 但仍然遇到同样的问题。 请帮助我,并提前感谢。
问候, V.Prashanth
你的语法是错误的。 请阅读文档: https://github.com/intuit/karate#header
And header Content-Type = 'blah'
And request { Grant_type: 'Value', scope: 'value' }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.