Page 1 of 1

Capturing Click Timings

Posted: Wed Jun 08, 2011 3:43 pm
by enneper
We are investigating using Ranorex to capture timings on various application click events; e.g. capture time it takes for response (with all screen rendering) to return to user following a button click.

What we are seeking is the ability to capture the timings as follows:
1. start timer
2. click button - button in down state
3. wait till web service calls return and screen is fully rendered
4. button is in up state (NOTE: this often happens before #3)
5. stop timer

Does anyone have a snippet of code that does this or at least steps 1, 2, 4, and 5?
Is there another way to tackle this problem that I don't see?

Application is HTML/javascript.

Thanks in advance.

Re: Capturing Click Timings

Posted: Wed Jun 08, 2011 4:17 pm
by Ciege
First things first.... Ranorex is not a performance test tool... Due to many variables with interacting with the GUI, querying objects, etc... your timings will never be perfectly accurate. That being said you can do the steps you want but be assured that they will not be as accurate as using a "real" performance tool (3rd party or written in house).
1. start timer
You can just get the "now" time of the system into a variable.

Code: Select all

System.DateTime dtStart = System.DateTime.Now;
2. click button - button in down state
You need a valid element in Ranorex, but then you can just call the click method

Code: Select all

MyButton.Click();
3. wait till web service calls return and screen is fully rendered
You didn't ask for instructions on this step so I assume you know how to do it already...
4. button is in up state (NOTE: this often happens before #3)
I'm not sure what value this will be if what you are really waiting for is the DOM object to become readystate=complete.
5. stop timer
Again, here get the "now" time of the system into a new variable, then you can compare the two.

Code: Select all

System.DateTime dtStop = System.DateTime.Now;

Re: Capturing Click Timings

Posted: Wed Jun 08, 2011 4:40 pm
by sdaly