cancel
Showing results for 
Search instead for 
Did you mean: 

Reusable REST Request approach

SOLVED
Regular Contributor

Reusable REST Request approach

can any one help the approach how to handle better ways for Re-usable REST Request (Test Steps) in multiple test cases

 

I have a scenarios where i need to Re-Use REST Requests in Multiples of test cases as Test Steps

 

What is the Best approach for this solution on ReadyAPI,

 

I am using Ready API 2.6v

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: Reusable REST Request approach

Hi @678,

 

Did additional suggestions help?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
6 REPLIES 6
Super Contributor

Re: Reusable REST Request approach

@678 - You can try below approach:-

def tCase = testRunner.testCase.testSuite.testCases["Name of test case"]
def tStep = tCase.testSteps["test step you want to run"]
tStep.run(testRunner, context)
Community Manager

Re: Reusable REST Request approach

Thanks for your help, avidCoder!

@678, is this what you are looking for?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Regular Contributor

Re: Reusable REST Request approach

So,i need the place this REST Request steps in one testsuite and need to call from there where ever i required by using Groovy Script step ? 

Community Hero

Re: Reusable REST Request approach

What difference it makes? End up to have groovy step instead of REST step?


Regards,
Rao.
Contributor

Re: Reusable REST Request approach

Place the rest request in its own test case then use the Run TestCase step to call the test case. If you need to pass data you can use the property transfer step to send the data to a properties step.

Highlighted
Community Manager

Re: Reusable REST Request approach

Hi @678,

 

Did additional suggestions help?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors