PeterKlim
11 years agoContributor
Looping until desired response
Hi
Need some suggestion , we have an excel sheet with 13000 rows of data and has couple of information which we need to write in the data sheet and also take some input from the data sheet,
There are 2 XML files which need to be sent as an input file to get the final response, the 1st xml gets the input parameter from the data sheet and from the response of the 1st xml file , request id is captured and entered as a request input for the second xml.
There are different status id which means different results , like eg is the status id is 6 that the result is “error” and if the status is 16 “ completed” is the result . So want add a condition that if the status is 11 which means in completed to keep looping through within the same request until we receive as error or completed as the status .
I'm not sure how, but how would I use this code?
if( status == “11” )
testRunner.runTestStepByName( "CheckRequest")
Or this code:
if( context.loopIndex == null )
context.loopIndex = 0
if( ++context.loopIndex < 10 )
testRunner.gotoStepByName( "Name of first TestStep in loop" )
I need to know how to get that part working where we loop though within the same row until the required status is received .
Need some suggestion , we have an excel sheet with 13000 rows of data and has couple of information which we need to write in the data sheet and also take some input from the data sheet,
There are 2 XML files which need to be sent as an input file to get the final response, the 1st xml gets the input parameter from the data sheet and from the response of the 1st xml file , request id is captured and entered as a request input for the second xml.
There are different status id which means different results , like eg is the status id is 6 that the result is “error” and if the status is 16 “ completed” is the result . So want add a condition that if the status is 11 which means in completed to keep looping through within the same request until we receive as error or completed as the status .
I'm not sure how, but how would I use this code?
if( status == “11” )
testRunner.runTestStepByName( "CheckRequest")
Or this code:
if( context.loopIndex == null )
context.loopIndex = 0
if( ++context.loopIndex < 10 )
testRunner.gotoStepByName( "Name of first TestStep in loop" )
I need to know how to get that part working where we loop though within the same row until the required status is received .