Hi Dirk,
Try using the following script:
function GetTestItemsInfo(testItems);
var i, testItem;
var itemsInfo : array [0..2]; // groupsCount, itemsCount, enabledItemsCount
var childItemsInfo : array [0..2]; // groupsCount, itemsCount, enabledItemsCount
begin
itemsInfo[0] := 0;
itemsInfo[1] := 0;
itemsInfo[2] := 0;
for i := 0 to testItems.ItemCount - 1 do
begin
testItem := testItems.TestItem(i);
if (nil = testItem.ElementToBeRun) then
begin
itemsInfo[0] := itemsInfo[0] + 1;
end;
if (testItem.ItemCount <> 0) then
begin
childItemsInfo := GetTestItemsInfo(testItem);
itemsInfo[0] := itemsInfo[0] + childItemsInfo[0];
itemsInfo[1] := itemsInfo[1] + childItemsInfo[1];
if testItem.Enabled then
begin
itemsInfo[2] := itemsInfo[2] + childItemsInfo[2];
end;
end
else
begin
itemsInfo[1] := itemsInfo[1] + 1;
if testItem.Enabled then
begin
itemsInfo[2] := itemsInfo[2] + 1;
end;
end;
end;
Result := itemsInfo;
end;
procedure CountTestItems();
var itemsInfo : array [0..2]; // groupsCount, itemsCount, enabledItemsCount
begin
itemsInfo := GetTestItemsInfo(Project.TestItems);
Log.Message('TestItems Information', 'Groups: ' + VarToStr(itemsInfo[0]) + #13#10 + 'Items: ' + VarToStr(itemsInfo[1]) + #13#10 + 'Enabled Items: ' + VarToStr(itemsInfo[2]));
end;
Is this what you need?