空手道框架:从示例部分传递空输入参数的 GET 方法
Karate Framework: GET method passing empty input parameters from Examples section
I have to validate a negative scenario where there are input parameters for GET call. My requirement is when input parameters are empty it should return proper error message as define by developer. My feature file looks like this:
Feature: Validate the response
Backgroud:
* url baseURL
* header Content-Type ='application/json'
Scenario Outline:<scenarioname>
Given url
And param param1 = <param1>
And param param2 = <param2>
When method <method>
Then status <statuscode>
Then print response
Examples:
|Scenario Number|scenarioname|method|statuscode|param1|param2|
|Scenario 1|validate the response|get|200|'abc'|'xyz'|
|Scenario 2|validate the response when both the params are blank|get|400|||
|Scenario 3||validate the response when both the params are blank|get|400|''|''|
- 当我执行场景 1 时,我的代码执行成功。
- 当我在控制台上执行场景 2 时,我可以看到 16:43:44.41 [main] INFO com.intuit.karate.Runner - 等待并行功能完成....但没有任何反应
- 当我执行场景 3 时,它会成功执行,如果我在 Soap 中执行相同的场景,那么我会在 Soap 中收到正确的错误消息 UI。
您在 Scenario Outline
中尝试做的事情太多了。只需单独编写 Scenario
-s。请仔细阅读这个答案,你也掉进了同样的陷阱:
其他问题没有意义,所以
a) 请尝试版本 0.9.6.RC4 - 因为有一些修复
b) 遵循这个过程:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
I have to validate a negative scenario where there are input parameters for GET call. My requirement is when input parameters are empty it should return proper error message as define by developer. My feature file looks like this:
Feature: Validate the response
Backgroud:
* url baseURL
* header Content-Type ='application/json'
Scenario Outline:<scenarioname>
Given url
And param param1 = <param1>
And param param2 = <param2>
When method <method>
Then status <statuscode>
Then print response
Examples:
|Scenario Number|scenarioname|method|statuscode|param1|param2|
|Scenario 1|validate the response|get|200|'abc'|'xyz'|
|Scenario 2|validate the response when both the params are blank|get|400|||
|Scenario 3||validate the response when both the params are blank|get|400|''|''|
- 当我执行场景 1 时,我的代码执行成功。
- 当我在控制台上执行场景 2 时,我可以看到 16:43:44.41 [main] INFO com.intuit.karate.Runner - 等待并行功能完成....但没有任何反应
- 当我执行场景 3 时,它会成功执行,如果我在 Soap 中执行相同的场景,那么我会在 Soap 中收到正确的错误消息 UI。
您在 Scenario Outline
中尝试做的事情太多了。只需单独编写 Scenario
-s。请仔细阅读这个答案,你也掉进了同样的陷阱:
其他问题没有意义,所以
a) 请尝试版本 0.9.6.RC4 - 因为有一些修复
b) 遵循这个过程:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue