Forum Discussion

mgroen2's avatar
mgroen2
Super Contributor
8 years ago

Measure performance (Windows application)

I would like to keep track of how much time a specific action on our application takes.
This action is triggered by a button on our UI. The application that needs to be tested is a windows application (non web-based).


What I want to achieve is following:
1. TestComplete activates the button in the UI, that triggers the action to be measured; A the same time TestComplete starts a timer;
2. After x amount of time (this could be seconds, minutes or hours), the result (of the action in point 1), is displayed on screen;
3. TestComplete recognizes that result in displayed on screen. And stops the timer;

By repeatedly running above scenario with multiple different datasets (the action to be triggered in point 1 results in SQL queries in the DB), we should be able to say useful things about the performance of our system running with different datasets / different hardware configurations.

 

Is this approach a wise one? Do other have experiences with above mentioned scenario and approach?

17 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    I would be second to Robert's suggestion about AQTime (https://smartbear.com/product/aqtime-pro/overview/). Been a specialized profiler it can provide you with a lot more details about your application in terms of performance and resources.

    You can profile application with AQTime without TestComplete, or TestComplete integrates with AQTime, so that TestComplete drives your application while AQTime profiles it.

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      Never used AQTime personally.

       

      But I agree with the others. You have to allow for the work TC needs to do to find the object before stopping the clock. Which can be thrown off kilter if:

       

      A new section is added to the application. The object model grows as a result. TC then takes a little longer to find the object. Timings from this point on increase slightly. This could also happen as a result of the application being in a different state at the point you decide to take the timing.

       

      If you change the hardware it's running on, your application may run faster or slower. But so will TC while tring to find the "stop" object. So times between hardware setup cannot always be considered representative.

       

      So yeah, as the other said, use more specialised profiling software.

       

      Or, the other option, is to have the devs insert a timestamp at some point their code which is stored as a property of your target "stop" object. Then it doesn't matter how long TC takes to find it. As long as it finds it, the timestamp will be stored within it and you can extract and use it at your leisure.

       

      This relies of having a helpful dev team on hand of course. And them inserting their timestamp at the correct point.

      • mgroen2's avatar
        mgroen2
        Super Contributor

        Gentlemen,

         

        thank you for all the usefull replies. I'll download the evaluation version of AQTime and evaluate what it can do for us.

         

        Thanks.

        Mathijs

         

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    That is a pretty good run down of how to do this task in TestComplete. I would suggest, for your timing, use the HISUtils.StopWatch object to start and stop the timer.

     

    Caveat:

    The result of the action, as you said, is something updated on screen. What this means is that TestComplete will need to find the object, check the necessary property, etc. This takes processing time. So, you're timing is going to include some of the overhead of TC doing that level of processing. This may be a matter of a few milliseconds or could be longer depending upon the timeout settings you use in your WaitProperty or WaitAliasChild or whatever methodology you use for the detection. So, as long as you're not looking for a 100% ACCURATE (e.g., "It takes on average 15 seconds for the query to return") measurements (more likely, "It takes on average 15 seconds for TestComplete to detect the query returns), that should work.

    Suggestion: Look into AQTime as a performance measurement tool. That does a bit more profiling stuff rather than having to work specifically with the object identification.