Friday, June 25, 2010

How to Use Dictionary Object in QTP?

Simple Code example for Dictionary object:-
Dim objDict 'Create a variable
Set objDict = CreateObject("Scripting.Dictionary")
objDict.Add "Name", "SP" 'Add some keys and items
objDict.Add "Address", "Street1"
objDict.Add "City", "Bangalore"
objDict.Add "State","Karnataka"
objDict.Add "Country","India"

For Each I in objDict
msgbox objDict.Item(I)
Next

Please find the infromation in the below.

http://www.learnqtp.com/dictionary-object-qtp-use/

Tuesday, June 22, 2010

Unlock QTP Script Which is Locked in Quality Center

Any script is locked in QC By other user, we can unlock script with below code.

Set QCConnection=QCUtil.QCConnection
Set con=QCConnection.command
con.CommandText="DELETE FROM LOCKS WHERE LK_USER ='QC User ID'" Set recset=con.execute