Tag Archive: dictionary

Sep 28 2013

Google Search Automation

Through the years I have been asked many times by novices to automation and QTP about Google/Gmail automation. This short post provides an example of Google search automation using a class (see below). The class encapsulates opening the Browser (invoking Internet Explorer), navigating to the Google.com page, searching and retrieving the results. The Main Procedure …

Continue reading »

Sep 01 2008

Complex Dictionary Usage

In this article we are about to see the efficiency of a dictionary when checking or retrieving values from a web-table, For this purpose we have the following table in our AUT. This is the script that will parse the table and will upload the dictionary. After running the script above, the solarExch dictionary loaded …

Continue reading »

Jun 19 2008

An Improved Dictionary Object

The Scripting.Dictionary object can be an extremely useful tool for storing and retrieving information. We’ve had a whole series of QTips covering it’s basic uses, as well as some advanced articles of using it as a reserved global dictionary, a parameter storage for generic functions (here and here), and more. However, with all its power, …

Continue reading »

Apr 23 2008

A Pitfall for Beginners when Working with a Dictionary

Introduction First and foremost I wish to thank two of my team members, Yasmin Helled and Eyas Kopty, who actually brought this issue to my attention. This post actually replaces an earlier post in which I prematurely and erroneously declared the issue as being a bug. My apologies to you, my loyal readers, for falling …

Continue reading »

Apr 01 2008

Add Elements to a Dictionary

Demonstration script that adds three key-item pairs to a Script Runtime Dictionary. Script must be run on the local computer. Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1”, “Printing” oDictionary.Add “Printer 2”, “Offline” oDictionary.Add “Printer 3”, “Printing”

Apr 01 2008

Delete All Elements from a Dictionary

Demonstration script that deletes all the key-item pairs from a Script Runtime Dictionary. Script must be run on the local computer Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1”, “Printing” oDictionary.Add “Printer 2”, “Offline” oDictionary.Add “Printer 3”, “Printing” keysCol = oDictionary.Keys Print “First run: ” For Each KeyStr in keysCol Print KeyStr Next oDictionary.RemoveAll keysCol = …

Continue reading »

Apr 01 2008

Delete One Element from a Dictionary

Demonstration script that deletes a specific key-item pair from a Script Runtime Dictionary. Script must be run on the local computer. Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1”, “Printing” oDictionary.Add “Printer 2”, “Offline” oDictionary.Add “Printer 3”, “Printing” keysCol = oDictionary.Keys Print “First run: ” For Each keyStr in keysCol Print keyStr Next oDictionary.Remove(“Printer 2”) keysCol= …

Continue reading »

Apr 01 2008

List the Number of Items in a Dictionary

Demonstration script that counts the number of key-item pairs in a Script Runtime Dictionary. Script must be run on the local computer. Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1”, “Printing” oDictionary.Add “Printer 2”, “Offline” oDictionary.Add “Printer 3”, “Printing” Print objDictionary.Count

Apr 01 2008

Dictionary of Employees

Demonstration script that combines the usage of classes and dictionary object. Script must be run on the local computer. Class Employee Private fname,lname,m_id,m_city,m_country Public Property Get FirstName() FirstName = fname End Property Public Property Let FirstName( value ) fname = value End Property Public Property Get LastName() LastName = lname End Property Public Property Let …

Continue reading »

Mar 29 2008

Implementing a Queue using a Dictionary

A Queue is a particular type of collection containing entities that are kept in order. The principal (or only) operations on the collection are the addition of entities to the last position and removal of entities from the first position. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the …

Continue reading »