Forum Discussion
jsreesoap
12 years agoContributor
For each iteration I am passing different values and executing a test steps.
Here is my script:
for(x in 0..10)
{
log.info "x"+x
if (x==0)
{
testRunner.testCase.testSuite.setPropertyValue("exeType", "A")
}
if (x==1){
testRunner.testCase.testSuite.setPropertyValue("AccType", "W")
}
if (x==2){
testRunner.testCase.testSuite.setPropertyValue("AccType", "E")
}
if (x==3){
testRunner.testCase.testSuite.setPropertyValue("AccType", "B")
}
if (x==4){
testRunner.testCase.testSuite.setPropertyValue("AccType", "Q")
}
if (x==5){
testRunner.testCase.testSuite.setPropertyValue("AccType", "X")
}
sleep 50
//from here Execution type is B
if (x==6){
testRunner.testCase.testSuite.setPropertyValue("exeType", "B")
}
if (x==7){
testRunner.testCase.testSuite.setPropertyValue("AccType", "W")
}
if (x==8){
testRunner.testCase.testSuite.setPropertyValue("AccType", "E")
}
if (x==9){
testRunner.testCase.testSuite.setPropertyValue("AccType", "B")
}
if (x==10){
testRunner.testCase.testSuite.setPropertyValue("AccType", "Q")
}
if (x==11){
testRunner.testCase.testSuite.setPropertyValue("AccType", "X")
}
testRunner.runTestStepByName("DataGen")
testRunner.runTestStepByName( "Groovy Script")
testRunner.runTestStepByName("ClosingDate groovy")
testRunner.runTestStepByName( "Authheader _A_B")
testRunner.runTestStepByName( "PropertyTransfer 1")
testRunner.runTestStepByName( "Create P504b_i_A_B")
}
when x==11 I want it to execute those test steps and stop.
I will your suggestion.
Thanks
Here is my script:
for(x in 0..10)
{
log.info "x"+x
if (x==0)
{
testRunner.testCase.testSuite.setPropertyValue("exeType", "A")
}
if (x==1){
testRunner.testCase.testSuite.setPropertyValue("AccType", "W")
}
if (x==2){
testRunner.testCase.testSuite.setPropertyValue("AccType", "E")
}
if (x==3){
testRunner.testCase.testSuite.setPropertyValue("AccType", "B")
}
if (x==4){
testRunner.testCase.testSuite.setPropertyValue("AccType", "Q")
}
if (x==5){
testRunner.testCase.testSuite.setPropertyValue("AccType", "X")
}
sleep 50
//from here Execution type is B
if (x==6){
testRunner.testCase.testSuite.setPropertyValue("exeType", "B")
}
if (x==7){
testRunner.testCase.testSuite.setPropertyValue("AccType", "W")
}
if (x==8){
testRunner.testCase.testSuite.setPropertyValue("AccType", "E")
}
if (x==9){
testRunner.testCase.testSuite.setPropertyValue("AccType", "B")
}
if (x==10){
testRunner.testCase.testSuite.setPropertyValue("AccType", "Q")
}
if (x==11){
testRunner.testCase.testSuite.setPropertyValue("AccType", "X")
}
testRunner.runTestStepByName("DataGen")
testRunner.runTestStepByName( "Groovy Script")
testRunner.runTestStepByName("ClosingDate groovy")
testRunner.runTestStepByName( "Authheader _A_B")
testRunner.runTestStepByName( "PropertyTransfer 1")
testRunner.runTestStepByName( "Create P504b_i_A_B")
}
when x==11 I want it to execute those test steps and stop.
I will your suggestion.
Thanks