26.6.13

Options to improve performance of QTP Scripts

There are umpteen ways to improve the performance of a script, here are some of my tips to improve performance, (at least the ones I can remember right now :-) ).
Will keep adding, and request you to do too.

Cheers!

  1. Ensure that Smart Identification is not invoked too often during execution by updating the concerned object's properties, but i would recommend to not disable entirely as it may cause script failure. 
  2. Also, object identification and manipulation is faster with DOM based methods, as compared to using Object Repository for the same task, because there is no overhead for object identification
  3. Remove or minimize the output to the QTP Print Log, and keep the statement as short as possible.
  4. Avoid having unnecessary columns in your database queries, have only the ones that are really required. 
  5. Avoid taking a screen shot at every step - restrict it for submitting pages, and errors.
  6. Change the Default Timeout options depending on your needs, but i would prefer to use this option as the last resort, because this may sometimes cause issues during execution.
  7. I like QTP Actions, but having a lot of actions within a single script may slow down script execution, especially if you are using LoadAndRunAction statement to call the actions dynamically in a loop of sorts. This will only get worse if you are calling the actions from QC. So, minimize the number of actions being called, or better still use as many Functions as possible because these are much faster than actions.
  8. For those of you who access data from an Excel, and that too on a shared drive, things could be faster if you directly import the entire sheet/file, rather than referring it via association, or reading line by line. I personally prefer to use a MS SQL Server Database for all my test data.