Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to minimze the script
#1
Solved: 11 Years, 4 Months ago
I have a 500 lines of script among this 300 lines of code start with
Browser("xxxxx").Page("xxxx").Frame("xxxxx") this sentense

i would like to minimze this code instead of writing entire thing in 300 lines , i just want to assign this entire sentense in to a variable and wherever it is required i want to pass this variable and with some extensions (according to my requirement like webedit, weblist, webelement,.....)

Please let me know how to minimze the script

Thanks in advance,
Venkat.Batchu
Reply
#2
Solved: 11 Years, 4 Months ago
Code:
Set oRobj = Browser("xxxxx").Page("xxxx").Frame("xxxxx") 'write this as the first line
' -- Do a Find and Replace , would look like below.
oRobj.Weblist("xx").Select "xxx"

Set oRobj = Nothing ' -- Write this at the 500th line
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Solved: 11 Years, 4 Months ago
Hi Venkat,

You can use "With" statements for ensuring precise & more readable code.

In QTP , Go to Edit Menu --> Apply "With" Statements --> Click OK

Let me know if it helps you Smile
Reply
#4
Solved: 11 Years, 4 Months ago
Thanks alot Basanth,
Now i am clear about these things....
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)