Forum Discussion
ReshmaSachdev
12 years agoContributor
Hello,
What I understand is that you want to execute following steps:
1) Data source
2) Test step1
3) Groovy1
4) Data source loop
And are expecting something like:
1) Data source
2) Groovy - to decide to test step1 or step2
3) Test step1
4) Groovy - to skip test step2 and go to Groovy1 as either test step1 is required or test step2
5) Test step2
6) Groovy1
4) Data source loop
You can achieve step 2) by using something like below script:
def var= 'get variable value from data source for which toggling is needed'
if(var == 'expected value to run step1')
{
myGotoStepName = 'Test Step1'
testRunner.gotoStepByName( myGotoStepName )
}
else
{
myGotoStepName = 'Test Step2'
testRunner.gotoStepByName( myGotoStepName )
}
And on similar lines you can built groovy for step 4)
Hope it may help...
What I understand is that you want to execute following steps:
1) Data source
2) Test step1
3) Groovy1
4) Data source loop
And are expecting something like:
1) Data source
2) Groovy - to decide to test step1 or step2
3) Test step1
4) Groovy - to skip test step2 and go to Groovy1 as either test step1 is required or test step2
5) Test step2
6) Groovy1
4) Data source loop
You can achieve step 2) by using something like below script:
def var= 'get variable value from data source for which toggling is needed'
if(var == 'expected value to run step1')
{
myGotoStepName = 'Test Step1'
testRunner.gotoStepByName( myGotoStepName )
}
else
{
myGotoStepName = 'Test Step2'
testRunner.gotoStepByName( myGotoStepName )
}
And on similar lines you can built groovy for step 4)
Hope it may help...