In qtp, how does one use intelliisense (smart and sensitive) to access custom vbs functions and objects?

Source: Internet
Author: User

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/

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.