In one of my very first posts on joecolantonio.com I listed 10 performance tips to help optimize your QTP code. Today I'd like to share four ways in which you can improve the execution time of your UFT with ALM.
I've seen many performance issues with QTP/QC over the years — especially with business process testing. The good news is that HP has slowly been fixed many of these issues. The bad news is that you need to get the latest and greatest versions of each tool in order to benefit from most of the enhancements.
This brings me to the first tip:
1. Be sure you're using the latest versions of UFT and ALM
As I mentioned, HP has addressed many of the performance issues I've raised, but often the only way to take advantage of some of the improvements is to upgrade to the latest versions of their products.
I'm aware that upgrading to the latest version is not always easy, so before doing the upgrade, be sure to contact HP. Sometimes they can give you hotfixes that haven't been released to the general public. (Please do not contact me for these, since HP requires that you contact them directly for any patch/hotfixes.)
2. Use the resources' functionality within ALM
One of the reasons for upgrading to the latest version of ALM and UFT is that there are some enhancements that have been made to the products that radically improve the performance. One of them is the use of resources.
Prior to QTP and QC 10, the main way to utilize resources was to use a relative path to the location of your resources with a list of folders to search. When running tests from either QTP or UFT, it will look for all resources needed and download them before opening and running your tests.
When you use the option of providing a patch to the resources folder in ALM, you will see your script really slow down because if there are a lot of resources, UFT needs to download all of them before running the tests. Not good. If you have to use paths, one way to improve performance is to make sure that your resources are organized in way that doesn't involve deeply nested/complicated folder structures. You want to make your directory structure as simple as possible.
HP recommends that instead of providing the path that you instead store resources in ALM and link them directly to your scripts using the “ALM Resources” option under the File dialog.
3. Reduce network latency
This applies to pretty much any tool, but you want to make sure that your network latency is not too slow. I believe HP found that every 50ms of network latency will cause your test script's execution time to degrade by 2.5 to 6 percent.
There are many things that can cause network latency, so you'll want to work with your network admins to find out how to improve that. A couple of simple things to try would be to either use a wired connection rather than Wi-Fi whenever possible, and/or to disable any firewalls you might have running.
4. Hidden Mode
One feature I don't believe all UFT/QTP engineers are aware of is that you can actually run your UFT/QTP tests in certain modes. One of those is “hidden mode”.
Using the Run UFT in hidden mode will improve your test execution because the UFT UI does not have to render every time a test runs. This will help free up some hardware resources that would normally go to the rendering piece of UFT. Also, since you're just interested in the results of the test it is often unnecessary to actually see UFT running.
To see how to change settings in the UFT Remote Agent check out my post on UFT Remote Agent Settings – How to Keep UFT/QTP Open after a test run.
Those are my top four UFT execution improvements to help Performance
Those are the four main things you can do to try to improve the execution time of your test scripts. Let me know what your top run time tips are in the comments below.
Hope it helps!