<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Dictionary Object in QTP. A complete guide.</title> <atom:link href="http://www.learnqtp.com/dictionary-object-qtp-use/feed/" rel="self" type="application/rss+xml" /><link>http://www.learnqtp.com/dictionary-object-qtp-use/</link> <description></description> <lastBuildDate>Tue, 31 Jan 2012 08:17:01 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>By: Scott Genevish</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-23228</link> <dc:creator>Scott Genevish</dc:creator> <pubDate>Thu, 19 Jan 2012 19:24:28 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-23228</guid> <description>Removing duplicates is easier with the .Item method rather than messing with .Exists.  Just call:
myDict.Item(&quot;keyname&quot;) = &quot;value&quot;
If the keyname does not exist, it will be added, otherwise the value will be updated.</description> <content:encoded><![CDATA[<p>Removing duplicates is easier with the .Item method rather than messing with .Exists.  Just call:</p><p>myDict.Item(&#8220;keyname&#8221;) = &#8220;value&#8221;</p><p>If the keyname does not exist, it will be added, otherwise the value will be updated.</p> ]]></content:encoded> </item> <item><title>By: SACHIN</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-22114</link> <dc:creator>SACHIN</dc:creator> <pubDate>Fri, 02 Dec 2011 07:29:08 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-22114</guid> <description>I AM HAVING PROBLEM,
IS IT POSSIBLE TO STORE COLLECTION INTO DICTIONARY
IF YES THEN,WHAT IS PROCEDURE FOR STORING COLLECTION IN TO DICTIONARY AND RETRIEVING IT</description> <content:encoded><![CDATA[<p>I AM HAVING PROBLEM,<br
/> IS IT POSSIBLE TO STORE COLLECTION INTO DICTIONARY<br
/> IF YES THEN,WHAT IS PROCEDURE FOR STORING COLLECTION IN TO DICTIONARY AND RETRIEVING IT</p> ]]></content:encoded> </item> <item><title>By: shruti</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-19327</link> <dc:creator>shruti</dc:creator> <pubDate>Fri, 07 Oct 2011 09:13:45 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-19327</guid> <description>good one</description> <content:encoded><![CDATA[<p>good one</p> ]]></content:encoded> </item> <item><title>By: Ujas Doshi</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-16932</link> <dc:creator>Ujas Doshi</dc:creator> <pubDate>Tue, 21 Jun 2011 10:47:20 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-16932</guid> <description>Hi All,
I have used dictionary object to remove duplicates in an array. I ll paste the code here. I hope it helps.
here, I have 2 arrays, TC() and Status()
TC contains test case IDs and Status contains their respective status. Of course, a TC ID can be repeated multiple time having multiple statuses like &quot;Test Passed&quot; or &quot;Test Failed&quot;.
My objective was to create a file that has the final status. If all the statuses for a test case is &quot;Test passed&quot;, it passes. Else, it is failed.
The following function converts the array to a dictionary object and removes the duplicated and also consolidates the status holding only the final status.
Thus, it is ready to be pasted to an excel file and sent to the manager.
Public Function converToDictionary( TC, Status)
Dim dict, j, k
k = Ubound(TC)
msgbox k
Set dict = CreateObject(&quot;Scripting.Dictionary&quot;)
For j = 0 to k
If dict.Exists(TC(j)) then
If dict(TC(j)) = &quot;Test Passed&quot; then
dict.Remove(TC(j))
dict.add TC(j), Status(j)
End If
Else
dict.add TC(j), Status(j)
End If
&#039;strMsg = strMsg &amp; TC(j)&amp; &quot; : &quot;&amp; dict.Item(TC(j)) &amp; vbcr
Next
Set converToDictionary = dict
End Function</description> <content:encoded><![CDATA[<p>Hi All,</p><p>I have used dictionary object to remove duplicates in an array. I ll paste the code here. I hope it helps.</p><p>here, I have 2 arrays, TC() and Status()</p><p>TC contains test case IDs and Status contains their respective status. Of course, a TC ID can be repeated multiple time having multiple statuses like &#8220;Test Passed&#8221; or &#8220;Test Failed&#8221;.</p><p>My objective was to create a file that has the final status. If all the statuses for a test case is &#8220;Test passed&#8221;, it passes. Else, it is failed.</p><p>The following function converts the array to a dictionary object and removes the duplicated and also consolidates the status holding only the final status.</p><p>Thus, it is ready to be pasted to an excel file and sent to the manager.</p><p>Public Function converToDictionary( TC, Status)<br
/> Dim dict, j, k<br
/> k = Ubound(TC)<br
/> msgbox k<br
/> Set dict = CreateObject(&#8220;Scripting.Dictionary&#8221;)<br
/> For j = 0 to k<br
/> If dict.Exists(TC(j)) then<br
/> If dict(TC(j)) = &#8220;Test Passed&#8221; then<br
/> dict.Remove(TC(j))<br
/> dict.add TC(j), Status(j)<br
/> End If<br
/> Else<br
/> dict.add TC(j), Status(j)<br
/> End If<br
/> &#8216;strMsg = strMsg &amp; TC(j)&amp; &#8221; : &#8220;&amp; dict.Item(TC(j)) &amp; vbcr<br
/> Next<br
/> Set converToDictionary = dict<br
/> End Function</p> ]]></content:encoded> </item> <item><title>By: kiran kumar</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-12207</link> <dc:creator>kiran kumar</dc:creator> <pubDate>Tue, 23 Nov 2010 14:36:09 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-12207</guid> <description>hi,
How do companies go for selecting the framework, what factors do they consider seleting a framework.</description> <content:encoded><![CDATA[<p>hi,</p><p>How do companies go for selecting the framework, what factors do they consider seleting a framework.</p> ]]></content:encoded> </item> <item><title>By: Manoj</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-7194</link> <dc:creator>Manoj</dc:creator> <pubDate>Tue, 09 Mar 2010 06:46:15 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-7194</guid> <description>Hi Friends,
Please suggest How to select Automation framework? Which factors we need to consider while seleting Automation framework?</description> <content:encoded><![CDATA[<p>Hi Friends,<br
/> Please suggest How to select Automation framework? Which factors we need to consider while seleting Automation framework?</p> ]]></content:encoded> </item> <item><title>By: Sandeep Khopade</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-6363</link> <dc:creator>Sandeep Khopade</dc:creator> <pubDate>Thu, 14 Jan 2010 12:15:43 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-6363</guid> <description>Does it decrese performance of system ?</description> <content:encoded><![CDATA[<p>Does it decrese performance of system ?</p> ]]></content:encoded> </item> <item><title>By: Fidel Raj</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-6027</link> <dc:creator>Fidel Raj</dc:creator> <pubDate>Sun, 03 Jan 2010 08:33:51 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-6027</guid> <description>Please ignore my above comment. Analyzed a little bit and found out that arrays can be used for sharing data between Actions.
Instead of using ProgID as &quot;Scripting.Dictionary&quot;, use ProgID as &quot;System.Components.ArrayList&quot;.
This will work only if you have .Net Framework installed on your comp.</description> <content:encoded><![CDATA[<p>Please ignore my above comment. Analyzed a little bit and found out that arrays can be used for sharing data between Actions.</p><p>Instead of using ProgID as &#8220;Scripting.Dictionary&#8221;, use ProgID as &#8220;System.Components.ArrayList&#8221;.</p><p>This will work only if you have .Net Framework installed on your comp.</p> ]]></content:encoded> </item> <item><title>By: Fidel</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-6009</link> <dc:creator>Fidel</dc:creator> <pubDate>Wed, 30 Dec 2009 18:20:08 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-6009</guid> <description>I dont think you can get similar functionality (in terms of sharing values between action) using arrays.</description> <content:encoded><![CDATA[<p>I dont think you can get similar functionality (in terms of sharing values between action) using arrays.</p> ]]></content:encoded> </item> <item><title>By: Ankur</title><link>http://www.learnqtp.com/dictionary-object-qtp-use/comment-page-1/#comment-2584</link> <dc:creator>Ankur</dc:creator> <pubDate>Tue, 26 May 2009 18:55:34 +0000</pubDate> <guid
isPermaLink="false">http://www.learnqtp.com/?p=226#comment-2584</guid> <description>@Scott: Agreed. In fact while working on arrays this looks cleaner, just a matter of habit.</description> <content:encoded><![CDATA[<p>@Scott: Agreed. In fact while working on arrays this looks cleaner, just a matter of habit.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching using disk: basic

Served from: www.learnqtp.com @ 2012-02-05 00:07:41 -->
