Test progress

Class library usage, coding and language questions.
Tstr
Posts: 2
Joined: Mon Mar 02, 2015 8:30 am

Test progress

Post by Tstr » Mon Mar 02, 2015 9:06 am

How can I determine the total number of activities that will be handled by
ActivityStack.Instance.BeginActivity
*before* (or while) the TestSuite is executed?

Background:
I want to implement a progress indicator that does not rely on the number of test cases (TestCaseActivity) but on a more fine granular classification.
Please, let me know, if there is any other (better) method achiveving this.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Test progress

Post by Support Team » Tue Mar 03, 2015 2:16 pm

Hello,

I don't know what exactly you want to do, but you can try the following method.
Ranorex.Core.Reporting.ActivityStack.Instance.VisitAll()
An example can also be found in the following forum post:
http://www.ranorex.com/forum/timestamps ... tml#p25108
Please note that this is an not official documented method which can be changed in future versions.

Regards,
Bernhard
.
Image

Tstr
Posts: 2
Joined: Mon Mar 02, 2015 8:30 am

Re: Test progress

Post by Tstr » Tue Mar 03, 2015 3:42 pm

Thank you for your reply.
Unfortunately, your suggested method does not work for me.


My progress indicator should show something like:
Progress: <activities_begun> / <total_activities>

I intend to increment activities_begun in the BeginActivity event handler.

Given the KeePassTestSuite setup shown in the attached picture, BeginActivity is fired 26 times.

Ideally, total_activites is equal to activities_begun at the end of the testrun :-)

How can I get this number beforehand?
Attachments
Keepass.PNG
Keepass.PNG (14.76 KiB) Viewed 976 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Test progress

Post by Support Team » Thu Mar 05, 2015 5:54 pm

Hello Tstr,

That's correct, the problem is that the total count of the activities is not available at the beginning.
I am not sure why this is necessary for your test, but I am afraid that this would require a lot of internal API methods which cannot be posted into the forum.
Maybe it is better to search for another approach. You could, for example iterate through the test suite XML file in order to get the needed information.

Regards,
Bernhard
.
Image

helmonferk
Posts: 1
Joined: Mon Jun 01, 2015 6:23 am

Re: Test progress

Post by helmonferk » Mon Jun 01, 2015 6:49 am

I had gone through the posts. Can you please provide me some more information about that.

User avatar
RobinHood42
Posts: 238
Joined: Fri Jan 09, 2015 3:24 pm

Re: Test progress

Post by RobinHood42 » Wed Jun 03, 2015 9:10 am

Hi,

Please explain in more detail which information do you need and what exactly do you want to do?

Cheers,
Robin