0 Shares 4780 Views

is your QTP Script execution slower??

Apr 24, 2013
4780 Views

Optimize QTP ScriptsAre you experiencing slow execution of your scripts? Does it takes much time to execute your scripts than it should be? If you feel that your qtp script execution has slowed down or there is a need to increase the speed, consider the points below to improve the performance of qtp script execution.

1. Set QuickTest Run Mode to Fast

Consider changing the run mode to fast. You can do this at Tools >Options > Run tab. The Change in behavior can be seen at run-time. The yellow execution arrow which you see in left bar of your script statements will not be there now. The tests will not expand the tree and it will not show up the scripts for each actions as well.

2. Images and movie capture

Until unless you don’t need, do not put these settings ON. These settings are at Tools > Options> Run > Screen Capture. Uncheck ‘save movie results’ and ‘save still images’. If you really want images to be captured, set it ‘for errors’ instead of ‘always’

3. Load only the required Add-ins 

Just load those add-ins which are required for your automation.

Uncheck all unwanted add-ins at  Add-in Manger at start up.

4. Disable Active Screen

Active screen takes lots of disk space and it makes your script slower. You can notice while modifying your scripts, update of the active screen takes few seconds to load. So until unless you don’t need it, Close the Active screen window and do not save the tests with active screen. clear the option ‘Save active screen file’ in ‘Save’ Dialog.

If you really want to have this, consider checking the Capture level at Tools > Options > Active Screen.

5. Recovery Scenario

This is very crucial as far as performance is concerned. Try not to use them as far as possible. avoid having unwanted pop ups like for printers, anti-virus etc on the machine. Some browser popups can be disabled manually by selecting “do not show this next time” before actually automating scripts.

Most of the recovery operations can be handled or avoided  from the script. for example – Exist method can be used for the statements  to avoid having situation for recovery scenario.
If you are using this, try avoiding it to enable for every step. Configure it at File > Settings > Recovery Scenario tab. Set “on error” for “activate recovery scenario”.

5. Importing sheet

If you are making use of external excel file and you are importing it into data table, then make sure you are doing it once, not for every iteration.

for example: If the first line of your script is Datatable.Import(filename) and you have enabled “run on all iterations”, you are simply importing the sheet every time unnecessarily.In such cases, set mode to “run one iteration only” and use a loop after import method

6. Declare variables

Scripts with variables declared are usually faster than the scripts where you don’t declare variables using DIM. If a variable is not declared it is always referenced by name every time it is used, which slows down the execution. Use OPTION EXPLICIT at the beginning of your script which forces to declare variables.

7. Avoid using Wait Statement

Use Exist or sync method for synchronization, rather using Wait statement.

8. Use Object Repository

Scripts run faster if all the objects are in the Object Repository rather using straight descriptive programming in the scripts. if you have a large object repository then also it creates performance issues. a mix of both should work better.

9. Use With Statement

Usage of with statements help in reducing number of function calls  and so the execution time. Use with statements for a set of  statements rather writing the same code multiple times.

So, these are some of the methods, which I would recommend to improve performance of your automation scripts.

You may be interested

UFT Patch Updates – UFT 14.03
Unified Functional Testing
1448 views1
Unified Functional Testing
1448 views1

UFT Patch Updates – UFT 14.03

Saket - Mar 11, 2018

Post the launch of UFT 14.0, there are three patch updates has been released including a number of features and enhancement. Recently Micro Focus unveiled third patch…

Setting up Web Service Automation Project
Katalon Studio
1305 views
Katalon Studio
1305 views

Setting up Web Service Automation Project

Saket - Oct 24, 2017

Web services are specific services that can be published and called over the Internet by client applications. Katalon Studio supports functional testing of web services. This topic…

Setting up Mobile Automation Project in MacOS
Katalon Studio
1081 views1
Katalon Studio
1081 views1

Setting up Mobile Automation Project in MacOS

Saket - Oct 09, 2017

Using Katalon Studio, mobile tester can design automation test for both Android and iOS to run on physical devices, cloud services and emulators. This tutorial explains how…

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...