Sign in to follow this  
Followers 0
rabhatt

Need to measure UI screen response using timer

8 posts in this topic

I need to measure my desktop application screen responses using timer functions. But it seems the timings are not proper. Any guidlines to use timer functions to measure screen response time.

* Below functions are recorded automatically -

WinWait("Sample Title","")

If Not WinActive("Sample Title","") Then WinActivate("Sample Title","")

WinWaitActive("Sample Title","")

* I'm trying to place start timer and end timer like this before and after above recorded code for synch -

$begin = TimerInit()

WinWait("Sample Title","")

If Not WinActive("Sample Title","") Then WinActivate("Sample Title","")

WinWaitActive("Sample Title","")

$dif = TimerDiff($begin)

BUT STILL THE TIMINGS ARE NOT CORRECT. PLEASE HELP.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

What do you mean by "not correct"? The values returned are in milliseconds.

Could you please post your results or error messages or whatever you get?

... measure my desktop application screen responses ...

Usually you present a GUI to the user, the user enters some information and then presses enter. You process the input and display the result.

One meaningful value is the time between pressing the enter key and displaying the result.

Do you want to measure performance of your own script or of another program?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

What do you mean by "not correct"? The values returned are in milliseconds.

Could you please post your results or error messages or whatever you get?

Usually you present a GUI to the user, the user enters some information and then presses enter. You process the input and display the result.

One meaningful value is the time between pressing the enter key and displaying the result.

Do you want to measure performance of your own script or of another program?

Thanks for the quick reply buddy. I want to test response of some of the screens and operations of my Desktop application. E.g. My application name is BE_Explorer. First screen is open project. It will take a while to open a project and show me main screen. Like that after opening project there are 3-4 other business transactions that I want to measure in terms of response time.

I'm confused about functions provided - WinWait, WinWaitActivate

While calculating timings I'm using above functions but timings returned are just 0.2 sec or something but when I actual do that operation and do clock timings its around 5-6 seconds.. so that is my confusion.

Attaching screen shot and highlighted area.

Is AutoIT have function to check some area of the screen within window based on that I can measure timings??

Share this post


Link to post
Share on other sites

Attaching screen shot and highlighted area.

Good idea. But unfortunately I can't see them ;)

Usually you start measuring response time when the user clicks enter (in your case: when the user has selected a project) until the screen with the result appears.

WinWait: Wait until the window exists. It doesn't matter if the window is active or not.

WinWaitActive: Wait until the window exists and is the active window.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Good idea. But unfortunately I can't see them ;)

Usually you start measuring response time when the user clicks enter (in your case: when the user has selected a project) until the screen with the result appears.

WinWait: Wait until the window exists. It doesn't matter if the window is active or not.

WinWaitActive: Wait until the window exists and is the active window.

Thanks buddy once again for replying. Well, WinWait and WinWaitActive seems working fine but problem is I need to capture timings since I do certain action and some text within the window changes. Is it that difficult with AutoIT? Need clue. Basically my idea is to measure screen response performance. I'm ataching the screen once again.

post-60627-12871604253439_thumb.jpg

Share this post


Link to post
Share on other sites

As I don't know your application I did the measurement with M$ Word.

I have done it this way:

  • Get the title of the main window
  • Wait for the file selection dialog to appear
  • Wait for the file selection dialog to be closed
  • Wait for the main window to become active
  • If the title of the main window has changed the measured time is displayed
Hope this helps.

AutoItSetOption("WinTitleMatchMode",2)              ; Match any substring in the title
$sWordTitle = "Microsoft Word"                      ; Part of the title that never changes
$sOpenDialog = "Öffnen"                                ; Title of the file selection dialog
$sWordTitleFull = WinGetTitle($sWordTitle)          ; Get full title of the screen before file selection
WinWaitActive($sOpenDialog)                         ; Wait for file selection dialog to be selected
WinWaitClose($sOpenDialog)                          ; Wait till the user has closed the file selection dialog (file selected or cancel)
$iTimer = TimerInit()                               ; Start timer
WinWaitActive($sWordTitle)                          ; Wait till the Word window is displayed
If $sWordTitleFull <> WinGetTitle($sWordTitle) Then ; Full title has changed = user has selected a document
    MsgBox(0,"Load time measurement","It took " & TimerDiff($iTimer) & " milliseconds to load the document")
Else
    MsgBox(0,"Load time measurement","File selection has been cancelled!")
EndIf

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

As I don't know your application I did the measurement with M$ Word.

I have done it this way:

  • Get the title of the main window
  • Wait for the file selection dialog to appear
  • Wait for the file selection dialog to be closed
  • Wait for the main window to become active
  • If the title of the main window has changed the measured time is displayed
Hope this helps.

AutoItSetOption("WinTitleMatchMode",2)              ; Match any substring in the title
$sWordTitle = "Microsoft Word"                      ; Part of the title that never changes
$sOpenDialog = "Öffnen"                                ; Title of the file selection dialog
$sWordTitleFull = WinGetTitle($sWordTitle)          ; Get full title of the screen before file selection
WinWaitActive($sOpenDialog)                         ; Wait for file selection dialog to be selected
WinWaitClose($sOpenDialog)                          ; Wait till the user has closed the file selection dialog (file selected or cancel)
$iTimer = TimerInit()                               ; Start timer
WinWaitActive($sWordTitle)                          ; Wait till the Word window is displayed
If $sWordTitleFull <> WinGetTitle($sWordTitle) Then ; Full title has changed = user has selected a document
    MsgBox(0,"Load time measurement","It took " & TimerDiff($iTimer) & " milliseconds to load the document")
Else
    MsgBox(0,"Load time measurement","File selection has been cancelled!")
EndIf

Thanks for your response buddy! The code and steps is quite clear. I think I can go ahead this way. But sometimes I need to measure transaction time where I have to verify state of certain controls changed or any spcific change in GUI. Those are is troublesome to automate.

Have you anytime done UI performance testing earlier? Any guidline will help.

Share this post


Link to post
Share on other sites

Thanks for your response buddy! The code and steps is quite clear. I think I can go ahead this way. But sometimes I need to measure transaction time where I have to verify state of certain controls changed or any spcific change in GUI. Those are is troublesome to automate.

Have you anytime done UI performance testing earlier? Any guidline will help.

Unfortunately I have not done any UI performance testing myself.

A combination of WinGetHandle, ControlGetHandle, ControLGetText etc. might help.

It depends on what you want to do.

If you can describe your problem in detail or have an example that might help ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0