Micro Focus QTP (UFT) Forums
Writing optimized QTP scripts - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Writing optimized QTP scripts (/Thread-Writing-optimized-QTP-scripts)



Writing optimized QTP scripts - jp@QTP - 06-16-2008

Hi,

I am using DP for developing Test Cases in VB Script. I am looking for some guidelines/best practices for developing optimized scripts. I googled a lot for some articles written in this direction. I didn't find any but http://www.advancedqtp.com/forums/index.php?topic=110. Can anyone share his/her useful views on this topic?

So far I found that most of the time is spent on setting values in various controls using statements like WebEdit.Set, WebList.Select ,etc. Is there any trick to optimize on this?

WebEdit.Object.value = <some value> is little faster but it is not very reliable and also it makes scripts IE specific. Additionally, if page gets reloaded then we have to use the undocumented init(). I think this can make my scripts fragile if HP wants to do so, isn't it? Any thoughts?

Thanks in advance


RE: Writing optimized QTP scripts - Ankur - 06-26-2008

nice question... I have put across a list of my experience with optimizing QTP scripts

>>So far I found that most of the time is spent on setting values in various controls using statements like WebEdit.Set, WebList.Select ,etc. Is there any trick to optimize on this?

if you are using DP make sure you are not using more than the required properties to uniquely identify the object. Other than that, I don't think much can be done for optimizing these statements.


RE: Writing optimized QTP scripts - jp@QTP - 06-30-2008

Thanks Ankur. It was indeed useful!