cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
Occasional Contributor

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff

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

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.

Regards,
/Li

View solution in original post

3 REPLIES 3
Highlighted
Staff

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

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.

Regards,
/Li

View solution in original post

Highlighted
Occasional Contributor

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

Is there any shortest  way to reduce the manual efforts.

Highlighted
Frequent Contributor

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

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

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Check out this week's challenge!

Create a script to generate an email when an assertion fails for the TechCorner tag!


Scripts created in July:
- A script to change the request body before sending it to the server
Top Kudoed Authors