cancel
Showing results for 
Search instead for 
Did you mean: 

TestedApps.Count is 1 when all testedapps are closed

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

Highlighted
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.
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors