Monday, 10 March 2014

QTP Dictionary Object

Dictionary Object ---------------------- Dim inputData Set inputData = CreateObject("Scripting.Dictionary") inputData.Add "Ag... thumbnail 1 summary
Dictionary Object
----------------------

Dim inputData
Set inputData = CreateObject("Scripting.Dictionary")

inputData.Add "Agent","Hyderabad"
inputData.Add "Password","mercury"
inputData.Add 1, 100
inputData.Add "d", #10/10/2010#
inputData.Add "*","ad"

Msgbox inputData.Count '5

Msgbox inputData.Item(1) '100

Msgbox inputData.Exists("*") 'True

inputData.Remove(1)

Msgbox inputData.Count '4

inputData.RemoveAll

Msgbox inputData.Count '0

-------------------------------------------------------------
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set inputData("Agent")
Dialog("Login").WinEdit("Password:").Set inputData("Password")
wait 1
Dialog("Login").WinButton("OK").Click

--------------------------------------------------------------------------------------------------------------------------
'Create a Word document
Dim objWord
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Add
objWord.ActiveDocument.SaveAs "C:\Documents and Settings\Administrator\Desktop\abcde.doc"
objWord.Quit


Set objWord = Nothing

No comments

Post a Comment