2

I have a 4 steps in a ReadyAPI only thing changes is step number.

def testStep = testRunner.testCase.testSteps['Verify Application1']

def testStep = testRunner.testCase.testSteps['Verify Application2']

def testStep = testRunner.testCase.testSteps['Verify Application3']

Now, I want to pass a variable instead of 1,2,3 in ReadyAPI step using groovy. So that I can add loop and iterate whenever i need.

Aman Khan
  • 103
  • 3
  • 11

1 Answers1

1

// Run a loop and use concatenation to generated the string you want

for(int i=1 ;i<=3 ;i++)
{
   str='Verify Application'
   str=str+i
   log.info str

    def testStep = testRunner.testCase.testSteps[str]

 }

output is like

enter image description here

Gaurav Khurana
  • 3,423
  • 2
  • 29
  • 38