Ask a Question

TestedApps.Count is 1 when all testedapps are closed

brudnick
Occasional Contributor

TestedApps.Count is 1 when all testedapps are closed

For good measure in my scripts, the last thing I do is:



if (TestedApps.Count > 0)

{

    TestedApps.CloseAll()

 }



When all the TestedApps in the project are closed, the value of count is 1.



Per AQA help topic:


"The TestedApps.Count property lets you get the total number of
items (TestedApps objects) that belong to the current project's list of applications to be
tested.  The Property Value is the integer that means the number of items in the application
list."


Seems to be wrong to me.


I guess the workaround is to check for >1.





2 REPLIES 2
tppegu
Contributor

RE: TestedApps.Count is 1 when all testedapps are closed

No, that won't help. You seem to have misunderstood the purpose of the count property. It simply tells you how many applications are in the TestedApps collection. It does not tell you how many of them are currently running.



You could write a function that checks each of the apps in the collection to see if there is a running process of that name, but for your purposes it is easier to just call CloseAll unconditionally.

brudnick
Occasional Contributor

RE: TestedApps.Count is 1 when all testedapps are closed

I guess it was wishful thinking on my part that the Count property does more than described.

CloseAll() it is.  Guess I'll have to ignore the warning when there are no TestedApps running.

Thanks.
cancel
Showing results for 
Search instead for 
Did you mean: