Jump to content

Need to measure UI screen response using timer


rabhatt
 Share

Recommended Posts

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.

Link to comment
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?

... 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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??

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...