Forum Discussion

rpfaucher1's avatar
rpfaucher1
Contributor
4 years ago
Solved

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). ...
  • AlexKaras's avatar
    AlexKaras
    4 years ago

    Hi,

     

    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).