Forum Discussion

678's avatar
678
Regular Contributor
6 years ago

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

  • avidCoder's avatar
    avidCoder
    Super Contributor

    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)
    • TanyaYatskovska's avatar
      TanyaYatskovska
      SmartBear Alumni (Retired)

      Thanks for your help, avidCoder!

      678, is this what you are looking for?

    • 678's avatar
      678
      Regular Contributor

      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 ? 

      • nmrao's avatar
        nmrao
        Champion Level 3
        What difference it makes? End up to have groovy step instead of REST step?