How
Qtp
Used in
Intelliisense
(Intelligent and sensitive) custom access
Vbs
Functions and objects?
Because
Qtp
Use
Vbs
As a scripting language
Oo
Defects in
Intelliisense
This is also because
Qtp
Of
IDE
This reduces the efficiency of script writing.
The following describes a method.
WSC
Encapsulation
Vbs
Script, registered
Com
Object, and then add
Qtp
The object registry is retained
Qtp
Medium
Intelliisense
Access.
(
1
) Create
WSC
File
<? XML version = "1.0"?>
<Component>
<? Component error = "true"
DEBUG = "true"?>
<Reference
Object = "scripting. Dictionary"/>
<Registration
Description = "functions" progid = "qtp. Functions"
Version = "1.00" classid = "{d
7c
40957-00d4
-41a
5-a87b-89d1db311423} ">
</Registration>
<Public>
<Method name = "setid"
Internalname = "setid" dispid = "0">
<Parameter
Name = "svalue"/>
</Method>
<Method name = "GETID">
</Method>
<Method
Name = "printmessage">
<Parameter
Name = "strmessage"/>
</Method>
</Public>
<Script language =
"VBScript">
<! [CDATA [
Dim
PID
Function
GETID ()
GETID
= PID
End
Function
Function
Setid (svalue)
PID
= Svalue
End
Function
Function
Printmessage (strmessage)
Msgbox
Strmessage
End
Function
]>
</SCRIPT>
</Component>
(
2
) Registration
WSC
File
Selected
WSC
File, right-click, and select "register"
Or run"
Regsvr32
"D:/qtp/mywork/intelliisensetest1/test. WSC"
"Command to register
(
3
) Register
Qtp
.
Open the registry and add"
Functions
And
Progid
,
Uiname
.
(
4
) In
Qtp
Used in
Intelliisense
Restart
Qtp
Then you can use
WSC
Function defined in the file. You can use"
Functions
"
Intelliisense
Function, enter"
Functions
", All available attributes and methods will pop up automatically.
Refer:
Http://www.advancedqtp.com/knowledge-base/articles/qtp-tricks4/qtp-hacks/intellisense-and-com/