Forum Discussion

Sangeetha's avatar
Sangeetha
Occasional Contributor
9 years ago
Solved

How to make test case redundant in REST for different parameter in each testcase?

Hi,

 

My first REST test request is as follows:

 

Request:

{

Parameter1: "value"

}

 

My Second REST test request has the same steps as first request but it has additional one parameter in the request. I need to add that to my second request. 

 

Request:

{

Parameter1: "value",

Parameter2:"value"}

 

Likewise i need to execute 18 test scenarios with different parameter. Is there any easy automation work to reduce my additional efforts? Please clarify?

  • Are you using query parameter? If so, maybe you can add all parameters without any values in your first test request and create it 18 times in your test scenarios based on this test request. Then in each test secnario you only add the value to the parameters you want to use.

3 Replies

  • Are you using query parameter? If so, maybe you can add all parameters without any values in your first test request and create it 18 times in your test scenarios based on this test request. Then in each test secnario you only add the value to the parameters you want to use.

    • Sangeetha's avatar
      Sangeetha
      Occasional Contributor

      Is there any shortest  way to reduce the manual efforts.

    • AAB's avatar
      AAB
      Regular Contributor

      Hi Li,

       

      this is also a problem for me. I have different TestSuites with each different testcases with 1 teststep. In the future I will need to make compilations of all those testcases to cover as much tests as possible. Our GET's are REST API's that needs a specific parameter for that testcase. But with the combinations afterwards, I will have like 2500 different possible combinations. I could reduce the testcase combinations but then I won't have "as much as possible" coverage. 

      I'm using ReadyAPI where I have created a webservice for my REST API in 'Projects'. In that REST Service I have entered multiple parameters. When I go to my project I need to fill in a particular parameter for that testcase. If I run the case I see in the RAW tab that RestAPI is putting all parameters after one other to query on all parameters. But, this is a dangerous thing to do as it could be that the empty parameter will give an answer, and that is something I don't need! I think this is more or less the same for Sangeetha. From where her question 'is there a shorter way'? And that would be my question too  :-) 

       

      Kind Regards,

      Chantal