How to obtain the name of the group when running a group of tests
Howdy, I have a project named "HermansProject" (just as an example lol).... from this project I have created two groups of tests... call them HermansGrp1 and HermansGrp2 (again, just as an example).
When I execute a group of tests (e.g. HermansGrp2), I would like each test script to obtain the Group name during it run?
How do I get a test script that is running via a group, to get the group name?
I am using VBScripting.
Any help appreciated.
Note: described below will work only if you started test execution using Test Items, exactly as you described. And will not work for tests started as individual routines or keyword tests.
As it is documented in the help topics that I mentioned previously: when TestComplete starts execution of Test Item(s), Project.TestItems.Current object refers to the currently executed test item of the lowest hierarchy. I.e., assuming, that the first test item under Full group is named as A, Project.TestItems.Current will reference test item A, but not Full.
Now you can iterate up the hierarchy of test items using the Parent property. Parent's value for the Full group will be null (Nothing for VBScript).