Capturing Click Timings

Class library usage, coding and language questions.
enneper
Posts: 2
Joined: Tue May 24, 2011 5:18 pm

Capturing Click Timings

Post by enneper » Wed Jun 08, 2011 3:43 pm

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.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Capturing Click Timings

Post by Ciege » Wed Jun 08, 2011 4:17 pm

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;
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Capturing Click Timings

Post by sdaly » Wed Jun 08, 2011 4:40 pm