Improving QuickTest Professional performance
Friday, August 22nd, 2008The following can help with QuickTest Professional performance issues:
1. Do not load unnecessary add-ins in the Add-in Manager when QuickTest starts.
2. Run your tests in “Fast” mode. From the Run tab in the Options dialog box, select the “Fast” option.
3. If you are not using the Active Screen while editing your test, hide the Active Screen. Choose View > Active Screen, or toggle the Active Screen toolbar button to hide the Active Screen.
4. Decide if and how much information you want to capture and save in the Active Screen. The more information you capture, the slower recording and editing times. You can choose from the following Active Screen options to improve performance:
4.1 If you are testing Windows applications, you can choose to save all Active Screen information in every step, save information only in certain steps, or to disable Active Screen captures entirely. You set this preference in the Active Screen tab of the Options dialog box.
4.2 If you are testing Web applications, you can disable screen capture of all steps in the Active Screen. From the Active Screen tab of the Options dialog box, click Custom Level to open the Custom Active Screen Capture Settings dialog box. Select the Disable Active Screen Capture option. This will improve recording time.
4.3 When you save a new test, or when you save a test with a new name using Save As, you can choose not to save the captured Active Screen files with the test by clearing the Save Active Screen files option in the Save or Save As dialog box. This is especially useful when you have finished designing your test and you plan to use your test only for test runs. Tests without Active Screen files open more quickly and use significantly less disk space.
5. Decide when you want to capture and save images of the application for the test results. Unless absolutely required, uncheck the options “Save still image capture to results” and “Save movie to results” present under Tools > Options > Run tab.
6. Define variables and function in an external .vbs files and not inside an action. Then associate these files with your test script. If you define a variable or a function in an action, during each iteration of a test run, memory will be allocated to those variables/functions and would not be released.
7. Have more RAM than what is recommended by HP and good processor speed (System Requirements for QTP 9.2 are “Minimum of 512 MB of RAM” and “Pentinum IV”).
8. When you have tests (QTP) running for a long period if time, there are chances of memory leaks. To avoid memory leakage, always restart QTP from time to time.
9. Avoid using hard coded wait(x) statement. Wait statement waits for full x seconds, even if the event has already occurred. Instead use .sync or .exist. When using .exist property, always set TimeOut value.
10. Use Descriptive Programming instead of Object Repository. The lesser the function calls the Object Repository, the faster the script runs.
11. If using Object Repository, use “With” statement which can be set in Tools > Options > General Tab > “Automatically Generate “With” statements after recording”. When using “With” statement, the reference to the object is getting stored in the memory and gets referenced without calling the Object Repository.
12. If using Object Repository, disable Smart Identification in File -> Settings -> Run Tab. Instead, add additional properties to an object, so QTP can identify it without using Smart Identification.
13. Make sure that Object Synchronization Timeout in File->Settings->Run is set to 1 second.
14. When using objects like DB connections or MS Office COM, make sure you don’t create and initialize these objects multiple times (e.g. re-opening an excel file whenever you write to it).
15. Make sure that code doesn’t wait for an event that has already occurred. For example, if you are using wait loop for an object to appear, do not simply wait for 20 seconds. Instead, wait until wait time has passed OR until the object appears. This way, if the object appears after 10 seconds, you do not waste 10 seconds.
Mike Girenko











