Get Profile Tests count

Kfir S.
Petach Tikva,

Aug 22, 2021
3 Posts

0  |  0  

Re: Get Profile Tests count

Hey,

I'm trying to get the total number of tests in a profile.
So far I managed to get it by using:

tvTests=m_frmMain.GetTreeView()
iCount = tvTests.Nodes.Count

But this solution also counts the number of Tasks.
I see that there is a TestExec procedure called "GetTestsCount()", but I don't know which object I need to pass as a parameter.

I Will appreciate your support

Regards,
Kfir

DrATEasy (Ron Y.)
Mission Viejo, CA

Aug 22, 2021
358 Posts

0  |  0  

Re: Get Profile Tests count

The GetTestCount() used with program/Task/Test object. Not designed for profiles.  You will have to loop on all nodes in the tree and count the ones that are not tasks.

Kfir S.
Petach Tikva,

Aug 22, 2021
3 Posts

0  |  0  

Re: Get Profile Tests count

How do I get the tree head and check if it is a test or not? Looping through the tree will be recursively I presume?

Solution Available
DrATEasy (Ron Y.)
Mission Viejo, CA

Aug 23, 2021
358 Posts

1  |  0  

Re: Get Profile Tests count

Something like:
tvTests: MSComctlLib.TreeView
node: MSComctlLib.Node
iLast, iCount, i : lLong

tvTests=TestExec.m_frmMain.GetTreeView()
iLast=tvTests.Count
iTestsCount=0
for i=0 to iLast
    node=tvTests.Nodes.Item(i)
    if GetNodeType(node)=ateNodeTest
             iCount=iCount+1
        endif
next


Ronnie

Kfir S.
Petach Tikva,

Aug 25, 2021
3 Posts

0  |  0  

Re: Get Profile Tests count

It's working, thanks!

Just needed to loop starting from 1



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]