Page 1 of 1

Checking when an application has opened - task manager

Posted: Thu Nov 21, 2013 3:57 pm
by missmarple
Hi,

I need to automate a test case which opens an Excel document from an email archiving system. The problem is: how do I measure - reliably - the time taken between the double-click on the document link in the archiving system and the moment when Excel has fully loaded the document ?
My ideas so far:
- open task manager, take a DateTime snapshot when double-clicking, and when Excel has appeared in the list, take a DateTime snapshot again. I haven't tried it yet, but it seems "laggy" to me.
- create a bespoke little app (C# or similar) which encapsulates all steps. Problem: that's not longer proper automation, rather, a Ranorex-triggered hack ;-) (I'd like it more maintainable...)
- Some Ranorex API magic - haven't found anything so far...

Any hints ladies and gents ? Thanks in advance !

Miss Marple

Re: Checking when an application has opened - task manager

Posted: Thu Nov 21, 2013 4:53 pm
by krstcs
Note that Ranorex is not a performance tool, so it may not be consistent, or reliable, for pure timing testing. With that understanding you might be able to do the following.

In a single module:
1. Start Excel with the associated file/path as an argument (or click the link, or whatever you do to get Excel to open the file you need...).
2. Use a validation action to validate that Excel is open and the file is visible and open.

The report will show the time that the module started and the time each action, including the validation, happened, which should give an indication of the time it took.

Re: Checking when an application has opened - task manager

Posted: Thu Nov 21, 2013 5:06 pm
by Swisside
Hello

I think krstcs provided a pretty nice solution.


if you need the duration (between the doubleclick and the document being loaded) for the rest of your test you could use this
public void test()
		{
			repo.myItem.DoubleClick();
			System.DateTime startTime = System.DateTime.Now;
			System.DateTime endTime = System.DateTime.Now;
			
			bool b = repo.myExcelSheet.Visible;
			while(true){
				if (b)
				{
					endTime = System.DateTime.Now;
					break;
					
				}
			}
			TimeSpan duration = endTime-startTime;
			Report.Log(ReportLevel.Info,duration.Seconds.ToString()+"."+duration.Milliseconds.ToString()+" seconds to start the document");
				
		}
It seems pretty accurate so far and not laggy (I tested the doubleclick from the Windows Explorer so your situation might differ)

Of course as-is the code snipset isn't easy to maintain but I'm pretty sure you cannot do it without using code.

Regards

Re: Checking when an application has opened - task manager

Posted: Mon Nov 25, 2013 12:30 pm
by missmarple
Thanks for the suggestions - will try it out right now and post feedback on results.
And yes - we're shoehorning Ranorex into a performance test situation... we tried on the protocol level and just couldn't get it to work. GUI is the only way we can measure response times, and the project have accepted that this is not going to be a correct-to-the-nanosecond kind of affair (I think) :)

Re: Checking when an application has opened - task manager

Posted: Fri Nov 29, 2013 1:01 pm
by missmarple
Hi,

in the end, this sufficed:

1.) Launch Excel download (and open) via return key and then measure with

2.)
while(repo.MicrosoftExcel.Self.Active == false)
{
Thread.Sleep(100);
}

Thanks for the suggestions !

Regards,
MM