lucky009
10 years agoNew Contributor
[R]Help with groovy script for executing certain test steps
Hell Guys,
I'm trying to execute a test suite with groovy script to read the csv file.
My order of test case:
1) Groovy Script:
Will fetch data from csv. The csv has 4 columns A, B, C and D.
If (A==1 && B!=1 && C!=1 && D!= 1)
{
testRunner.goTotestStep("TestRequest1")
}
else if (A==1 && B==1 && C!=1 && D!= 1)
{
testRunner.goTotestStep("TestRequest1")
testRunner.goTotestStep("TestRequest2")
else if (A==1 && B==1 && C==1 && D!= 1)
{
testRunner.goTotestStep("TestRequest2")
..
..
..
..else {
testRunner.gotoStepByName("End")
}
2) Test Request1
3) Test Request 2
4) Test Request 3
5) Test Request 4
6) Conditional ToGo - Target as Groovy script
The problem is my script is not looping through given condition.
It is executing all Test Request1, Test Request2, Test Request3, Test Request4 for the first condition instead of just execute Test Request1.
Can you guys englighten me here?
Thanks for your help in advance.
I'm trying to execute a test suite with groovy script to read the csv file.
My order of test case:
1) Groovy Script:
Will fetch data from csv. The csv has 4 columns A, B, C and D.
If (A==1 && B!=1 && C!=1 && D!= 1)
{
testRunner.goTotestStep("TestRequest1")
}
else if (A==1 && B==1 && C!=1 && D!= 1)
{
testRunner.goTotestStep("TestRequest1")
testRunner.goTotestStep("TestRequest2")
else if (A==1 && B==1 && C==1 && D!= 1)
{
testRunner.goTotestStep("TestRequest2")
..
..
..
..else {
testRunner.gotoStepByName("End")
}
2) Test Request1
3) Test Request 2
4) Test Request 3
5) Test Request 4
6) Conditional ToGo - Target as Groovy script
The problem is my script is not looping through given condition.
It is executing all Test Request1, Test Request2, Test Request3, Test Request4 for the first condition instead of just execute Test Request1.
Can you guys englighten me here?
Thanks for your help in advance.