Forum Discussion

swati1's avatar
Occasional Contributor
5 years ago

,Using groovy script to run rest api test suite.How can i add delay between test test cases


i am using groovy script to run my REST API test suite and want to put delay for few test cases but not sure how and where.For Eg. test case name is verify password , reconcile password and verify password again.

So want to put delay between reconcile password and verify password again Bz reconile password test case takes time to perform the reconcilation of password where we have to wait for 2-3 minutes atleast .


Below is the groovy script that i m using :

def testcases = testRunner.testCase.testSuite.getTestCaseList()
// for all testCases in your test suite...
testcases.each { testcase ->
    // for all testStep inside testCase...
    def teststeps = testcase.getTestStepList()
    mylist = ['']
    for(i in mylist)
     teststeps.each { teststep ->
        endpoint = teststep.getPropertyValue('endpoint')
         def r =, context) "RUNNING Service :: ${testcase.getName()} -> ${teststep.getName()}" "RESULT :: ${r.getStatus()}" "---------------------------------------------------------------"





6 Replies