Ask a Question

REST Request Test Step is not running when i ran it from test case

Occasional Contributor

REST Request Test Step is not running when i ran it from test case

HI all,


Goal: my goal is to run my script million times to store my values in DB, it ran fine upto 760000 and stopped . since then its not running from test case or when i run it from script (from my 3rd test step) so i want to finish remaining 300000 records)



Please help me on this ,(more details as follows)


Suddenly my test step stops running when i run it from test case, when i open Test step i am seeing (attachment 1 with no raw response) 


- Please see my attachment 2 where i am sending valid json response by getting data from Project properties


I ran same request on test step itself and it ran fine and Output is also displaying as expected (see attachment 3)


When You look at My test case you notice i created 3 test steps

1. POST request 

2. Groovy script with below code and 

3. Groovy test step with Below code



2. code as follows


def parsedJson = new groovy.json.JsonSlurper().parseText(context.response) parsedJson
// def arg = [parsedJson.permissionName,parsedJson.scopeObjectId,parsedJson.userId]

def PnameTextAndValue = CallPermissions(parsedJson.permissionName)
PnameTextAndValue = PnameTextAndValue.substring(PnameTextAndValue.indexOf("[") + 1, PnameTextAndValue.indexOf("]"))
def Pnamefields = PnameTextAndValue.split(',');
int PnameIntVlal = Pnamefields[1].toInteger() + 1
def PnameAlpha = Pnamefields[0] + PnameIntVlal.toString() "PnameAlpha--->"+PnameAlpha
testRunner.testCase.testSuite.project.setPropertyValue("permissionName", PnameAlpha)

def SOIdTextAndValue = CallPermissions(parsedJson.scopeObjectId)
SOIdTextAndValue = SOIdTextAndValue.substring(SOIdTextAndValue.indexOf("[") + 1, SOIdTextAndValue.indexOf("]"))
def SOIdfields = SOIdTextAndValue.split(',');
int SOIdIntVlal = SOIdfields[1].toInteger() + 1
def SOIdAlpha = SOIdfields[0] + SOIdIntVlal.toString() "SOIdAlpha--->"+SOIdAlpha
testRunner.testCase.testSuite.project.setPropertyValue("scopeObjectId", SOIdAlpha)

def UIdTextAndValue = CallPermissions(parsedJson.userId)
UIdTextAndValue = UIdTextAndValue.substring(UIdTextAndValue.indexOf("[") + 1, UIdTextAndValue.indexOf("]"))
def UIdfields = UIdTextAndValue.split(',');
int UIdIntVlal = UIdfields[1].toInteger() + 1
def UIdAlpha = UIdfields[0] + UIdIntVlal.toString() "UIdAlpha--->"+UIdAlpha
testRunner.testCase.testSuite.project.setPropertyValue("userId", UIdAlpha)


String CallPermissions(def currentFieldValue )
String[] parseArg = currentFieldValue.split("(?<=\\d)(?=\\D)|(?=\\d)(?<=\\D)");
def numb = Arrays.toString(parseArg[1])
String numbResult = numb.substring(numb.indexOf("[") + 1, numb.indexOf("]"));
// int IntVlal = numbResult.toInteger()
// "IntVlal--->"+IntVlal (Arrays.toString(parseArg[0]))
String TextResult = (Arrays.toString(parseArg[0]))
TextResult = TextResult.substring(TextResult.indexOf("[") + 1, TextResult.indexOf("]")); "TextResult-->"+TextResult

return [TextResult,numbResult]



3. Code as follows



for(int i=1; i<=300000; i++)
def testStep = testRunner.testCase.testSteps['POST'] testRunner, context )
def testStep1 = testRunner.testCase.testSteps['IncrementPermission'] testRunner, context )


Occasional Contributor

its sorted and working fine

Esteemed Contributor

Just as a note, you posted this in the TestComplete forum, not the ReadyAPI or SoupUI forum.  

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Occasional Contributor

thanks i will make sure i will post my questions in there

Showing results for 
Search instead for 
Did you mean: