Recent Post

QTP @ VBScript > Dictionary Object

 QTP @ VBScript > Dictionary Object

QTP @ Dictionary Object
0        What is Dictionary Object?
0        Dictionary object consists of a collection of  elements called key-item pairs
0        A Dictionary object is similar to an associative array or a typical array.
0        The difference between a dictionary object and an array is that there is a unique key associated with every item of dictionary object.
0        This unique key can help you in calling that item as and whenever required.
0        A key is a unique entry: no two keys within a single Dictionary object can be the same. The item is just a value that goes along with a particular key. You can have as many duplicate items as you want, it’s only the keys that need to be unique

0        Dictionary: Object that stores data key, item pairs.
0        The Dictionary object functions as an associative array; that is, it stores values in key-item pairs.
0        The Dictionary object is similar to a Collection objects
0        You can access each item stored to a Dictionary object by using the For Each ...Next construct

0        Example of Key _ Item Pair values
0                        Police                    GAReddy            
0                        Doctor                  ReddyGA            
0                        Lawyer                GAR


Method or Property
Description
Methods

Add
Adds a new item to the dictionary
Exists
Verifies whether a given key exists in the dictionary
Items
Returns an array with all the values in a dictionary
Keys
Returns an array with all the keys in a dictionary
Remove
Removes the item identified by the specified key
RemoveAll
Removes all the items in the dictionary
Properties

Count
Returns the number of items in a dictionary
Item
Sets and returns an item for the specified key
Key
Changes an item's key

0 comments:

Post a Comment

GAReddy @ OneTestingCenter @ All Articles