Forum Discussion
Jack21Z
12 years agoOccasional Contributor
Hi
What if I have two or more classes under "module-name", how can I instantiate all the classes on my groovy script
ex.
Lib
--module-name
--example
--other_class
--other_class2
--other_class3
--....
Other_Test_Suite
--TestCase
--groovy_script
Do I have to do the following?:
Or there are other ways like:
Thanks in advance,
Jack
What if I have two or more classes under "module-name", how can I instantiate all the classes on my groovy script
ex.
Lib
--module-name
--example
--other_class
--other_class2
--other_class3
--....
Other_Test_Suite
--TestCase
--groovy_script
Do I have to do the following?:
library = testRunner.testCase.testSuite.project.testSuites["Library"]
module = library.testCases["module-name"].testSteps["Example"]
module2 = library.testCases["module-name"].testSteps["other_class"]
module3 = library.testCases["module-name"].testSteps["other_class2"]
....
module.run(testRunner, context)
module2.run(testRunner, context)
module3.run(testRunner, context)
Or there are other ways like:
library = testRunner.testCase.testSuite.project.testSuites["Library"]
for(int i = 0; i <= [i]number_of_classes[/i]; i++){
library.testCases["module-name"].testSteps[i].run(testRunner, context)
}
// [i]i[/i] is the order of class under module_name
Thanks in advance,
Jack
Related Content
- 6 years ago
Recent Discussions
- 19 days ago