Search code examples
apigetkarate

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. When i execute scenario 1 my code executes successfully.
  2. When i execute scenario 2 on console i can see as 16:43:44.41 [main] INFO com.intuit.karate.Runner - waiting for parallel feature to complete.... And nothing happens
  3. When i execute scenario 3 it executes successfully,if same scenario i execute in Soap then i get proper error message in Soap UI.

Solution

  • You are trying to do too much in a Scenario Outline. Just write separate Scenario-s. Please read this answer very carefully, you have fallen into the same trap: https://stackoverflow.com/a/54126724/143475

    The other issues don't make sense, so

    a) please try version 0.9.6.RC4 - because there were some fixes

    b) follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue