<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4461730588425548224</id><updated>2026-10-16T23:08:55.351-07:00</updated><category term="QTP Tips"/><category term="QTP Tricks."/><category term="QTP Codes."/><category term="DOM methods for QTP"/><category term="DOT Net Factory"/><category term="QTP."/><category term="QTP"/><category term="QTP Codes Samples"/><category term="QTP Screen Capture"/><category term="Webtable"/><category term="Xpath and QTP"/><category term="ADODB"/><category term="AOM Setting"/><category term="Add path"/><category term="Array List."/><category term="Balloon Tool Tip in QTP"/><category term="Bitmap Capture"/><category term="CSS for QTP"/><category term="ChildItem and ChildItemCount methods"/><category term="Code Creator."/><category term="DOM"/><category term="DOM INPUT"/><category term="DOM WEBEDIT"/><category term="DOM Webradiogroup DOM Radio Button Radio Button Disabled"/><category term="DOT Factory for Image"/><category term="DOT Net Factory (Browser Control)"/><category term="EXCEL COM"/><category term="EXCEL Column Names"/><category term="Excel Application QTP GetObject CreateObject Quit Excel Application Workbooks"/><category term="GUID"/><category term="GetFiles"/><category term="Getting Cursor Position from WebEdit"/><category term="HTML"/><category term="HTML DOM"/><category term="Hashtable"/><category term="Hyper Link Excelsheet Workbooks Worksheet QTP and Excel"/><category term="Image Merge"/><category term="MSDASQL"/><category term="New QTP Features"/><category term="NewList"/><category term="NodeByPath"/><category term="OpenSchema"/><category term="PathFinder"/><category term="Pathfinder.Insert"/><category term="Pathfinder.Locate"/><category term="QC BugFactory"/><category term="QC OTA"/><category term="QC OTA Filter"/><category term="QC OTA Multiple Filters"/><category term="QC TestSetFactory"/><category term="QTP 11 Runscript method"/><category term="QTP 11 new feature for Xpath"/><category term="QTP Bitmap Capture Bitmap Highlight Text In QTP"/><category term="QTP Email"/><category term="QTP Object Identification"/><category term="QTP RegisterUserFunc GetRowWithCellText Webtable"/><category term="QTP Screen Changing Screen Resolution Qres MultiRes"/><category term="QTP Script Talk QTP Tricks QTP sapi"/><category term="QTP Setting"/><category term="QTP Start Up"/><category term="QTP WebEdit Cursor Position"/><category term="QTP WebEdit Selection"/><category term="QTP Webtable Tricks"/><category term="QTP Xpath Object Identification"/><category term="QTP Xpath examples"/><category term="QTP and DOM"/><category term="QTP and Javascript"/><category term="QTP and XPATH"/><category term="QTP password masking"/><category term="Querying Text File."/><category term="Random Strings"/><category term="Random Test Data"/><category term="Remove All"/><category term="Remove Pathfinder"/><category term="Resize Bitmap Using QTP DotNetFactory System.Drawing.Image"/><category term="Runscript methodmeth"/><category term="Selection.createRange"/><category term="Sending Email in QTP"/><category term="Snag IT and QTP Capture"/><category term="System.IO.Directory"/><category term="TDApiOle80.TDConnection"/><category term="Test Setting"/><category term="TestSet"/><category term="TextRange"/><category term="TreeManager"/><category term="Unknown QTP Webtable Methods"/><category term="Using QTP DotNetFactory System.Drawing.Image"/><category term="VB Script Class QTP Code Reuse Object Function"/><category term="WMI"/><category term="WMI for QTP"/><category term="Web Table Display."/><category term="Webedit"/><category term="Weblist"/><category term="Weblist Sorting"/><category term="Webtable Border"/><category term="Wild Card for FSO"/><category term="XML Dom"/><category term="XPATH Identification"/><category term="Xpath Query"/><category term="Xpath Samples"/><category term="moveStart"/><title type='text'>QTP Codes - Quick Test Professional</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-7302906890128660992</id><published>2012-01-02T07:44:00.001-08:00</published><updated>2012-01-02T08:21:41.983-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP and XPATH"/><category scheme="http://www.blogger.com/atom/ns#" term="QTP Xpath examples"/><category scheme="http://www.blogger.com/atom/ns#" term="XPATH Identification"/><category scheme="http://www.blogger.com/atom/ns#" term="Xpath Samples"/><title type='text'>More Xpath for Web Objects</title><content type='html'>&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Identifying using Id attribute&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;obj.WebEdit(&quot;xpath:=//input[@id=&#39;htmlID&#39;]&quot;).Set &quot;QTP&quot;&lt;/pre&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Identifying using Type attribute&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;obj.WebEdit(&quot;xpath:=//input[@type=&#39;text&#39;][1]&quot;).Set &quot;QTP&quot;&#39;Setting value in first textBox&lt;/pre&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Identifying using Tagname&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;obj.WebList(&quot;xpath:=//select[1]&quot;).Select &quot;London&quot;&#39;Highlighting first listBox&lt;/pre&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Identifying using Innertext&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;obj.Link(&quot;xpath:=//a[.=&#39;Google&#39;]&quot;).Click&#39;Clicking Google link&lt;/pre&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Identifying WebTable based on Rowcount&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;obj.WebTable(&quot;xpath:=//table[count(.//tr)=2]&quot;).Highlight &#39;Highlighting the table which has only two rows&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;span&gt;More examples will be added&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/7302906890128660992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2012/01/more-xpath-for-web-objects.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/7302906890128660992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/7302906890128660992'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2012/01/more-xpath-for-web-objects.html' title='More Xpath for Web Objects'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-3497985279821023109</id><published>2011-10-31T04:41:00.000-07:00</published><updated>2011-10-31T04:56:11.583-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP 11 Runscript method"/><category scheme="http://www.blogger.com/atom/ns#" term="QTP and Javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="Runscript methodmeth"/><title type='text'>Running Javascript in QTP</title><content type='html'>&lt;SPAN&gt;You can run Javascript in QTP using &lt;b&gt;Runscript&lt;/b&gt; method. This is a new feature in QTP 11. Here is an example for it.&lt;/SPAN&gt;&lt;pre class=&quot;VB&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Set oPage=Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;)&lt;br /&gt;&lt;br /&gt;Set oTxtGoogle=oPage.RunScript(&quot;document.getElementsByName(&#39;q&#39;)(0);&quot;)&lt;br /&gt;&#39;The above line gets DOM object for Google textbox using Javascript.&lt;br /&gt;&lt;br /&gt;oTxtGoogle.Value=&quot;qtp&quot;&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;span&gt;I hope it is helpful.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/3497985279821023109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/running-javascript-in-qtp.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/3497985279821023109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/3497985279821023109'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/running-javascript-in-qtp.html' title='Running Javascript in QTP'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-8661827102194668627</id><published>2011-10-21T22:40:00.000-07:00</published><updated>2011-10-22T06:32:07.489-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NewList"/><category scheme="http://www.blogger.com/atom/ns#" term="NodeByPath"/><category scheme="http://www.blogger.com/atom/ns#" term="QC BugFactory"/><category scheme="http://www.blogger.com/atom/ns#" term="QC OTA"/><category scheme="http://www.blogger.com/atom/ns#" term="QC OTA Filter"/><category scheme="http://www.blogger.com/atom/ns#" term="QC OTA Multiple Filters"/><category scheme="http://www.blogger.com/atom/ns#" term="QC TestSetFactory"/><category scheme="http://www.blogger.com/atom/ns#" term="TDApiOle80.TDConnection"/><category scheme="http://www.blogger.com/atom/ns#" term="TestSet"/><category scheme="http://www.blogger.com/atom/ns#" term="TreeManager"/><title type='text'>Retrieve values from Quality Center Test Lab and Defects tab using OTA</title><content type='html'>&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Getting the Number of Passed, Failed, No Run and Not Completed Test cases&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;We can make use of the Filter as given below to get the number of Test cases according to the status Passed, Failed, No Run, Not Completed,etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Dim tdc, qcServer&lt;br /&gt;Dim qcUsername,qcPassword,qcDomain,qcProject&lt;br /&gt;&lt;br /&gt;Set tdc = CreateObject(&quot;TDApiOle80.TDConnection&quot;)&lt;br /&gt;qcServer = &quot;QC URL&quot;&lt;br /&gt;tdc.InitConnectionEx qcServer&lt;br /&gt;&lt;br /&gt;If tdc.Connected Then&lt;br /&gt;  Msgbox &quot;Connected to QC&quot;&lt;br /&gt;  Else&lt;br /&gt;  MsgBox &quot;Not connected to QC&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;qcUsername = &quot;Your QC Username&quot; &#39;Username&lt;br /&gt;qcPassword = &quot;Your Password&quot;   &#39;Password&lt;br /&gt;tdc.Login qcUsername, qcPassword&lt;br /&gt;&lt;br /&gt;If tdc.LoggedIn Then&lt;br /&gt;  MsgBox &quot;Logged in to QC&quot;&lt;br /&gt;  Else&lt;br /&gt;  MsgBox &quot;Logged out from QC&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;qcDomain = &quot;Domain&quot; &#39;QC Domain Name&lt;br /&gt;qcProject = &quot;Project&quot; &#39;QC Project Name&lt;br /&gt;&lt;br /&gt;tdc.Connect qcDomain, qcProject&lt;br /&gt;&lt;br /&gt;Dim vPath: vPath=&quot;Root\Account1\Proj1&quot; &#39;Path to the folder containing test set&lt;br /&gt;Dim vPass,vFail,vNR,vNC&lt;br /&gt;&lt;br /&gt;Dim oTestSet: Set oTestSet = tdc.TestSetTreeManager.NodeByPath(vpath).TestSetFactory.NewList(&quot;&quot;).Item(1).TsTestFactory &#39;Item(1) Refers to the 1st test set in the path&lt;br /&gt;Dim testFilter1: Set testFilter1 = oTestSet.Filter&lt;br /&gt;&lt;br /&gt;&#39;To Filter by Passed status&lt;br /&gt;testFilter1.Filter(&quot;TC_STATUS&quot;) = &quot;Passed&quot;&lt;br /&gt;vPass = vPass + oTestSet.NewList(testFilter1.Text).Count&lt;br /&gt;&lt;br /&gt;&#39;To Filter by Failed Status&lt;br /&gt;testFilter1.Filter(&quot;TC_STATUS&quot;) = &quot;Failed&quot;&lt;br /&gt;vFail = vFail + oTestSet.NewList(testFilter1.Text).Count&lt;br /&gt;&lt;br /&gt;&#39;To Filter by No Run status&lt;br /&gt;vNR = vNR + oTestSet.NewList(&quot;[Filter]{TableName:TESTCYCL,ColumnName:TC_STATUS,LogicalFilter:&quot; &amp;amp; Chr(39) &amp;amp; &quot;No&quot; &amp;amp; Chr(32) &amp;amp; &quot;Run&quot; &amp;amp; Chr(39) &amp;amp; &quot;,VisualFilter:&quot; &amp;amp; Chr(39) &amp;amp; &quot;No&quot; &amp;amp; Chr(32) &amp;amp; &quot;Run&quot; &amp;amp;Chr(39) &amp;amp; &quot;,NO_CASE:}&quot;).Count&lt;br /&gt;&lt;br /&gt;&#39;To Filter by Not Completed status&lt;br /&gt;vNC = vNC + oTestSet.NewList(&quot;[Filter]{TableName:TESTCYCL,ColumnName:TC_STATUS,LogicalFilter:&quot; &amp;amp; Chr(39) &amp;amp; &quot;Not&quot; &amp;amp; Chr(32) &amp;amp; &quot;Completed&quot; &amp;amp; Chr(39) &amp;amp; &quot;,VisualFilter:&quot; &amp;amp; Chr(39) &amp;amp; &quot;Not&quot; &amp;amp; Chr(32) &amp;amp;&quot;Completed&quot; &amp;amp; Chr(39) &amp;amp; &quot;,NO_CASE:}&quot;).Count&lt;br /&gt;&lt;br /&gt;Msgbox &quot;Passed: &quot;&amp;amp;vPass&amp;amp;&quot; Failed: &quot;&amp;amp;vFail&amp;amp;&quot; No Run: &quot;&amp;amp;vNR&amp;amp;&quot; Not Completed: &quot;&amp;amp;vNC&lt;br /&gt;&lt;br /&gt;Set testFilter1=Nothing&lt;br /&gt;&lt;br /&gt;Set oTestSet=Nothing&lt;br /&gt;&lt;br /&gt;Set tdc=Nothing&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Getting the Number of Test cases executed by a tester in a specific test set&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;We can use the below code to get the count of test cases executed by a tester in a particular test set.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Dim vPath: vPath=&quot;Root\Account1\Proj1&quot; &#39;Path to the folder containing test set&lt;br /&gt;&lt;br /&gt;Dim oTestSet: Set oTestSet = tdc.TestSetTreeManager.NodeByPath(vpath).TestSetFactory.NewList(&quot;&quot;).Item(1).TsTestFactory &#39;Item(1) Refers to the 1st test set in the path ; tdc refers to the test&lt;br /&gt;connection object in the previous snippet&lt;br /&gt;&lt;br /&gt;Dim testFilter1: Set testFilter1 = oTestSet.Filter&lt;br /&gt;Dim vtestcount: vtestcount=0&lt;br /&gt;Dim tester_name:tester_name=&quot;divya&quot; &#39;QC username of the tester for whom the count has to be calculated&lt;br /&gt;testFilter1.Filter(&quot;TC_ACTUAL_TESTER&quot;) =chr(34)&amp;amp;Cstr(tester_name)&amp;amp;chr(34)&lt;br /&gt;&lt;br /&gt;vtestcount = vtestcount + oTestSet.NewList(testFilter1.Text).Count&lt;br /&gt;Msgbox &quot;Number of Test Cases executed by &quot;&amp;amp;tester_name&amp;amp;&quot; : &quot;&amp;amp;vtestcount&lt;br /&gt;Set testFilter1=Nothing&lt;br /&gt;Set oTestSet=Nothing&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Getting the number of defects raised by a tester in a specific release according to severity&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;We need to apply multiple filters as we are using Tester name, Release Name and Defect Severity as the criteria.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Dim Bug_Ct:Bug_Ct=0&lt;br /&gt;Dim tester_name:tester_name=&quot;divya&quot;&lt;br /&gt;Dim test_severity:test_severity=&quot;2-High&quot;&lt;br /&gt;&lt;br /&gt;Dim oBugFactory: Set oBugFactory=tdc.BugFactory&lt;br /&gt;Dim TotBugcnt: TotBugcnt=oBugFactory.NewList(&quot;&quot;).Count &#39;To get the total number of defects in Defects tab.&lt;br /&gt;Dim oBugFilter1:Set oBugFilter1=oBugFactory.Filter&lt;br /&gt;&lt;br /&gt;oBugFilter1.Filter(&quot;BG_DETECTED_BY&quot;)=tester_name &#39;QC username of the tester for whom the defect count has to be calculated&lt;br /&gt;oBugFilter1.Filter(&quot;BG_DETECTED_IN_REL&quot;) = &quot;^Releases\proj1\1.1.01.201^&quot; &#39;Name of the Release&lt;br /&gt;oBugFilter1.Filter(&quot;BG_SEVERITY&quot;)=test_severity &#39;Defect Severity. Eg.: Can be 2-High, 1-Critical, 4-Low. Possible Values can be obtained from QC defects tab&lt;br /&gt;&lt;br /&gt;Bug_Ct = Bug_Ct + oBugFactory.NewList(oBugFilter1.Text).Count&lt;br /&gt;Msgbox Bug_Ct&lt;br /&gt;&lt;br /&gt;Set oBugFilter1=Nothing&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Getting the number of defects in a specific release according to defect status&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Here we need to apply the following criteria: Release Name, Defect status.&lt;/span&gt;&lt;span&gt; If we want to be more specific , say, we need to find the same for a particular tester, then we  can include tester name as a filter criteria.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;The following code will give the output for number of defects raised in a specific release having the status &quot;Closed&quot; which were raised by tester1 and tester2.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;&lt;br /&gt;Dim Bug_Ct:Bug_Ct=0&lt;br /&gt;Set oBugFactory=tdc.BugFactory&lt;br /&gt;Set oBugFilter1=oBugFactory.Filter&lt;br /&gt;oBugFilter1.Filter(&quot;BG_DETECTED_IN_REL&quot;) = &quot;^Releases\proj1\1.1.01.201^&quot; &#39;Name of the Release&lt;br /&gt;oBugFilter1.Filter(&quot;BG_STATUS&quot;)=&quot;Closed&quot; &#39;Defect status for which count is calculated&lt;br /&gt;oBugFilter1.Filter(&quot;BG_DETECTED_BY&quot;)=&quot;tester1 or tester2&quot; &#39;QC Username of the testers for whom the count is calculated&lt;br /&gt;Bug_Ct = Bug_Ct + oBugFactory.NewList(oBugFilter1.Text).Count&lt;br /&gt;Msgbox Bug_Ct&lt;br /&gt;Set oBugFilter1=Nothing&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/8661827102194668627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/retrieve-values-from-quality-center.html#comment-form' title='28 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/8661827102194668627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/8661827102194668627'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/retrieve-values-from-quality-center.html' title='Retrieve values from Quality Center Test Lab and Defects tab using OTA'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>28</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-7496947428565971985</id><published>2011-10-11T10:26:00.000-07:00</published><updated>2011-10-11T10:33:27.410-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Getting Cursor Position from WebEdit"/><category scheme="http://www.blogger.com/atom/ns#" term="moveStart"/><category scheme="http://www.blogger.com/atom/ns#" term="QTP WebEdit Cursor Position"/><category scheme="http://www.blogger.com/atom/ns#" term="QTP WebEdit Selection"/><category scheme="http://www.blogger.com/atom/ns#" term="Selection.createRange"/><category scheme="http://www.blogger.com/atom/ns#" term="TextRange"/><title type='text'>How To Get Cursor Position From WebEdit</title><content type='html'>&lt;span&gt;The below snippet can be used to get the cursor position from WebEdit&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Dim oPage:Set oPage=Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;)&lt;br /&gt;Dim oSel:Set oSel=oPage.Object.Selection.createRange&lt;br /&gt;Dim oWebEdit:Set oWebEdit=oPage.WebEdit(&quot;name:=q&quot;).Object&lt;br /&gt;&lt;br /&gt;oSel.moveStart &quot;character&quot;,-Len(oWebEdit.value)&lt;br /&gt;&lt;br /&gt;Msgbox  Len(oSel.text)&#39;Here you will get the cursor position.&lt;br /&gt;&lt;br /&gt;Set oPage=Nothing&lt;br /&gt;Set oSel=Nothing&lt;br /&gt;Set oWebEdit=Nothing&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/7496947428565971985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/how-to-get-cursor-position-from-webedit.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/7496947428565971985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/7496947428565971985'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/how-to-get-cursor-position-from-webedit.html' title='How To Get Cursor Position From WebEdit'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-320904571480681561</id><published>2011-10-10T00:25:00.000-07:00</published><updated>2011-10-11T10:35:12.931-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="New QTP Features"/><category scheme="http://www.blogger.com/atom/ns#" term="QTP 11 new feature for Xpath"/><category scheme="http://www.blogger.com/atom/ns#" term="QTP Object Identification"/><category scheme="http://www.blogger.com/atom/ns#" term="QTP Xpath Object Identification"/><category scheme="http://www.blogger.com/atom/ns#" term="Xpath and QTP"/><title type='text'>Xpath Based QTP Object Identification</title><content type='html'>&lt;span&gt;Xpath object identification is a new feature in QTP 11. I would like to share an example for it using Google web page&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Dim oPage&lt;br /&gt;&lt;br /&gt;Set oPage=Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;)&lt;br /&gt;&lt;br /&gt;oPage.WebEdit(&quot;xpath:=//INPUT[@name=&#39;q&#39;]&quot;).Set &quot;advancedqtp&quot;&#39;Entering value in Google textbox.&lt;br /&gt;&lt;br /&gt;oPage.WebButton(&quot;xpath:=//INPUT[@value=&#39;Google Search&#39;]&quot;).Click&#39;Clicking Google Search button.&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;span&gt;Try it and enjoy&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/320904571480681561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/qtp-object-identification-using-xpath.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/320904571480681561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/320904571480681561'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/qtp-object-identification-using-xpath.html' title='Xpath Based QTP Object Identification'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-1792460058842740732</id><published>2011-10-06T07:07:00.000-07:00</published><updated>2011-10-06T09:12:44.284-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DOT Net Factory"/><category scheme="http://www.blogger.com/atom/ns#" term="GetFiles"/><category scheme="http://www.blogger.com/atom/ns#" term="System.IO.Directory"/><category scheme="http://www.blogger.com/atom/ns#" term="Wild Card for FSO"/><title type='text'>Getting File Path List Using Wild Card Characters</title><content type='html'>&lt;Span&gt;In this article, I would like to share how to get the file path for the files which are residing in a folder using wild card.&lt;/Span&gt;&lt;br&gt;&lt;br&gt;&lt;span&gt;Consider the case where we have a folder containing text files temp.txt, tem.txt, temp1.txt, temp2.txt.&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span&gt;In the above text file list if we want to get path for the files using “temp*.txt” wild card, GetFiles (System.IO.Directory) method can be used.&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Dim inFile,oColFilesList,oArrayList,oDI&lt;br /&gt;&lt;br /&gt;Set oArrayList=DotNetFactory.CreateInstance(&quot;System.Collections.ArrayList&quot;,&quot;&quot;)&lt;br /&gt;Set oDI=DotNetFactory.CreateInstance(&quot;System.IO.Directory&quot;,&quot;mscorlib&quot;)&lt;br /&gt;&lt;br /&gt;Set oColFilesList=oArrayList.Adapter(oDI.GetFiles(&quot;C:\Files List&quot;,&quot;temp*.txt&quot;))&lt;br /&gt;&lt;br /&gt;For inFile=0 to Cint(oColFilesList.Count)-1&lt;br /&gt;Msgbox oColFilesList(inFile)&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Set oArrayList=Nothing&lt;br /&gt;Set oDI=Nothing&lt;br /&gt;Set oColFilesList=Nothing&lt;br /&gt;&lt;/pre&gt;&lt;span&gt;The above code will retrieve paths of temp.txt, temp1.txt, and temp2.txt files but not for tem.txt file.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/1792460058842740732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/getting-file-path-list-using-wild-card.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/1792460058842740732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/1792460058842740732'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/getting-file-path-list-using-wild-card.html' title='Getting File Path List Using Wild Card Characters'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-6502527156963939788</id><published>2011-10-04T11:18:00.000-07:00</published><updated>2011-10-04T11:26:22.504-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DOT Factory for Image"/><category scheme="http://www.blogger.com/atom/ns#" term="Image Merge"/><category scheme="http://www.blogger.com/atom/ns#" term="Using QTP DotNetFactory System.Drawing.Image"/><title type='text'>Merging Images Using DOT NET Factory</title><content type='html'>&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;&lt;br /&gt;strImage1Path=&quot;C:\Sunset.jpg&quot;&lt;br /&gt;strImage2Path=&quot;C:\Winter.jpg&quot;&lt;br /&gt;strMergedImagePath=&quot;C:\MergeImage.jpg&quot;&#39;Path where the merged image is to be stored.&lt;br /&gt;&lt;br /&gt;Set oImage=DotNetFactory.CreateInstance(&quot;System.Drawing.Image&quot;,&quot;System.Drawing&quot;)&lt;br /&gt;Set oGraph=DotNetFactory.CreateInstance(&quot;System.Drawing.Graphics&quot;,&quot;System.Drawing&quot;)&lt;br /&gt;Set oPens=DotNetFactory.CreateInstance(&quot;System.Drawing.Pens&quot;,&quot;System.Drawing&quot;)&lt;br /&gt;Set oImage1=oImage.FromFile(strImage1Path)&lt;br /&gt;Set oImage2=oImage.FromFile(strImage2Path)&lt;br /&gt;&lt;br /&gt;inWidth=Cint(oImage1.Width)+Cint(oImage2.Width)&lt;br /&gt;&lt;br /&gt;If oImage1.Height &gt;=oImage2.Height Then&lt;br /&gt; inHeight=Cint(oImage1.Height )&lt;br /&gt; Else&lt;br /&gt;  inHeight=Cint(oImage2.Height )&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;Set oBmp=DotNetFactory.CreateInstance(&quot;System.Drawing.Bitmap&quot;,&quot;System.Drawing&quot;,inWidth,inHeight)&lt;br /&gt;&lt;br /&gt;Set gr=oGraph.FromImage(oBmp)&lt;br /&gt;&lt;br /&gt;gr.DrawRectangle oPens.Black,0,0,Cint(inWidth)-1,Cint(inHeight)-1&lt;br /&gt;&lt;br /&gt;gr.DrawImage oImage1,0,0&lt;br /&gt;gr.DrawImage oImage2,oImage1.Width,0&lt;br /&gt;&lt;br /&gt;oBmp.Save(strMergedImagePath)&lt;br /&gt;&lt;br /&gt;Set oImage=Nothing&lt;br /&gt;Set oGraph=Nothing&lt;br /&gt;Set oPens=Nothing&lt;br /&gt;Set oImage1=Nothing&lt;br /&gt;Set oImage2=Nothing&lt;br /&gt;Set oBmp=Nothing&lt;br /&gt;Set gr=Nothing&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/6502527156963939788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/merging-images-using-dot-net-factory.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/6502527156963939788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/6502527156963939788'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/merging-images-using-dot-net-factory.html' title='Merging Images Using DOT NET Factory'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-2642421686241326137</id><published>2011-10-03T11:02:00.000-07:00</published><updated>2011-10-03T11:11:59.375-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADODB"/><category scheme="http://www.blogger.com/atom/ns#" term="EXCEL Column Names"/><category scheme="http://www.blogger.com/atom/ns#" term="EXCEL COM"/><category scheme="http://www.blogger.com/atom/ns#" term="MSDASQL"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenSchema"/><title type='text'>Retrieving Excel Column Names Using ADODB</title><content type='html'>&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;strExcelPath=&quot;C:\Book1.xls&quot;&lt;br /&gt;strTableName=&quot;Sheet1$&quot;&#39;Note: $ symbol should be included with Table Name.&lt;br /&gt;Set oCon=CreateObject(&quot;ADODB.Connection&quot;)&lt;br /&gt;&lt;br /&gt;With oCon&lt;br /&gt;.Provider = &quot;MSDASQL&quot;&lt;br /&gt;.ConnectionString = &quot;Driver={Microsoft Excel Driver (*.xls)};&quot; &amp; _&lt;br /&gt;&quot;DBQ=&quot;&amp;strExcelPath&amp;&quot;; ReadOnly=False;&quot;&lt;br /&gt;.Open&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;Set oRs1=oCon.OpenSchema(4,Array(Empty, Empty,strTableName,Empty))&lt;br /&gt;&lt;br /&gt;Do Until oRS1.EOF&lt;br /&gt;Msgbox oRs1.Fields.Item(&quot;COLUMN_NAME&quot;).Value&lt;br /&gt;oRS1.MoveNext&lt;br /&gt;Loop&lt;br /&gt;&lt;br /&gt;oRs1.Close&lt;br /&gt;oCon.Close&lt;br /&gt;&lt;br /&gt;Set oRs1=Nothing&lt;br /&gt;Set oCon=Nothing&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/2642421686241326137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/retrieving-excel-column-names-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2642421686241326137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2642421686241326137'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/10/retrieving-excel-column-names-using.html' title='Retrieving Excel Column Names Using ADODB'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-5845324498301806001</id><published>2011-09-29T11:14:00.000-07:00</published><updated>2011-09-30T11:09:27.279-07:00</updated><title type='text'>QTP Codes blog is being updated</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;QTP Codes blog is being updated. You will see post design changes shortly.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/5845324498301806001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/09/qtp-codes-blog-is-being-updated.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/5845324498301806001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/5845324498301806001'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/09/qtp-codes-blog-is-being-updated.html' title='QTP Codes blog is being updated'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-3299923955858505413</id><published>2011-09-29T11:07:00.000-07:00</published><updated>2011-10-01T12:19:43.866-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Add path"/><category scheme="http://www.blogger.com/atom/ns#" term="PathFinder"/><category scheme="http://www.blogger.com/atom/ns#" term="Pathfinder.Insert"/><category scheme="http://www.blogger.com/atom/ns#" term="Pathfinder.Locate"/><category scheme="http://www.blogger.com/atom/ns#" term="Remove All"/><category scheme="http://www.blogger.com/atom/ns#" term="Remove Pathfinder"/><title type='text'>More Methods For PathFinder Object</title><content type='html'>&lt;span&gt;Most of us are aware of the Locate method available for PathFinder object. But there are more useful and unfamiliar methods associated with PathFinder Object. I would like to share how these methods can be used in QTP.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;# INSERT&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;This method is used to add a new folder path to the Folders list (Tools-&amp;gt; Options-&amp;gt; Folders).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;PathFinder.Insert [Path],[Index]&lt;/pre&gt;&lt;span&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;PathFinder.Insert &quot;C:\Test&quot;,0&lt;/pre&gt;&lt;span&gt;The above example will add new folder path to the Folders list.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;# FIND&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;This method returns the Index of the specified path.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Msgbox PathFinder.Find [Path]&lt;/pre&gt;&lt;span&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Msgbox PathFinder.Find(&quot;C:\Test&quot;)&lt;/pre&gt;&lt;span&gt;The above example returns the Index of the specified path. If the path is not found, it will return -1.&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;# MOVEITEM&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;This method can be used to swap the Index of two folder paths.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Pathfinder.MoveItem [Source_Index],[Destination_Index]&lt;/pre&gt;&lt;span&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Pathfinder.MoveItem 1,0&lt;/pre&gt;&lt;br&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;# REMOVE&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;This method removes the specified folder path from the folders list.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Pathfinder.Remove [Path]&lt;/pre&gt;&lt;span&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Pathfinder.Remove(&quot;C:\Test&quot;)&lt;/pre&gt;&lt;br&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;# REMOVEALL&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;This method removes all the items from the folders list.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Syntax/Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Pathfinder.RemoveAll&lt;/pre&gt;&lt;span&gt;Note: It removes default folder item as well.&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;# REMOVEBYINDEX&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;This method removes the folder path item using Index.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;PathFinder.RemoveByIndex([Path_Index])&lt;/pre&gt;&lt;span&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;PathFinder.RemoveByIndex(0)&lt;/pre&gt;&lt;br&gt;&lt;span STYLE=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;# SAVE&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;This method can be used to commit all the changes which are done using PathFinder object. If Save method is not used, your changes in Folder List will not be retained.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Syntax/Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;PathFinder.Save&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/3299923955858505413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2011/09/more-methods-for-pathfinder-object.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/3299923955858505413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/3299923955858505413'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2011/09/more-methods-for-pathfinder-object.html' title='More Methods For PathFinder Object'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-7008188831781835917</id><published>2010-11-28T01:19:00.000-08:00</published><updated>2011-09-30T11:07:29.695-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP Webtable Tricks"/><category scheme="http://www.blogger.com/atom/ns#" term="Unknown QTP Webtable Methods"/><title type='text'>Unknown QTP Webtable Methods</title><content type='html'>The below listed unknown QTP webtable methods were present in Astra LoadTest. But we are still able to use these methods in QTP. I would like to share this to you.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;#1 CellText&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;This method works as same as GetCellData method.&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Eg.: Msgbox Browser(&quot;name:=qtp&quot;).WebTable(&quot;index:=0&quot;).CellText(1,1)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;#2 CellTextByContext &lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;This method returns the text within a cell delimited by a character. We can retrieve the text before (or) after the delimiter using this method.&lt;br /&gt;Eg.: Consider a cell having the text “Asiq;Ahamed”. Here “;’ is the delimiter&lt;br /&gt;&lt;br /&gt;Code to retrieve the text before the delimiter&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Msgbox Browser(&quot;name:=qtp&quot;).WebTable(&quot;index:=0&quot;).CellTextByContext(1,1,&quot;&quot;,&quot;;&quot;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Code to retrieve the text after the delimiter&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Msgbox Browser(&quot;name:=qtp&quot;).WebTable(&quot;index:=0&quot;).CellTextByContext(1,1,&quot;;&quot;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;#3 TextCellExist&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This method checks whether a text exists in a cell or not. It returns true, if the input text exists in the cell, else it returns false. Rather than using GetCellData method and then comparing the result with the input text, we can achieve it using this simple method.&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;Msgbox Browser(&quot;name:=qtp&quot;).WebTable(&quot;index:=0&quot;).TextCellExist(1,1,&quot;asiq&quot;)&lt;br /&gt;&lt;/pre&gt;I hope this is useful to all.</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/7008188831781835917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/11/more-qtp-webtable-methods.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/7008188831781835917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/7008188831781835917'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/11/more-qtp-webtable-methods.html' title='Unknown QTP Webtable Methods'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-2486912929981571231</id><published>2010-11-21T06:47:00.000-08:00</published><updated>2011-09-30T11:14:05.864-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DOM INPUT"/><category scheme="http://www.blogger.com/atom/ns#" term="DOM methods for QTP"/><category scheme="http://www.blogger.com/atom/ns#" term="DOM WEBEDIT"/><title type='text'>Beware of setting value in webedit using DOM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;TEXT-ALIGN: left&quot; trbidi=&quot;on&quot;&gt;If you set value in a disabled webedit, QTP will throw the below error.&lt;br&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg96AI8g-6zUTikQWfixbVHoCrDJHs-S9LW3Qz4rjBn4kyxuCKN11-CVsF_IBqu8hY_pID2y_zOignh_y0l1TiAoqmGgGCz9TqAuVPUrBo-RBTnzoqkJVile-QBAJjqEJYYc4laGMgt1g/s1600/Error.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5542016412156127490&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 385px; CURSOR: hand; HEIGHT: 145px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg96AI8g-6zUTikQWfixbVHoCrDJHs-S9LW3Qz4rjBn4kyxuCKN11-CVsF_IBqu8hY_pID2y_zOignh_y0l1TiAoqmGgGCz9TqAuVPUrBo-RBTnzoqkJVile-QBAJjqEJYYc4laGMgt1g/s400/Error.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;But do not enter value in webedit using DOM. The problem is: You can set value in web text box even it is disabled.&lt;br /&gt;We have a work around for this.&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Set obj=Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;).WebEdit(&quot;index:=1&quot;).Object&lt;br /&gt;If Not obj.disabled Then&lt;br /&gt;obj.Value =&quot;qtp&quot;&lt;br /&gt;End If&lt;/pre&gt;I always use DOM to retrieve text or count no. of objects. I hope this is helpful.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/2486912929981571231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/11/dont-use-dom-to-set-value.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2486912929981571231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2486912929981571231'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/11/dont-use-dom-to-set-value.html' title='Beware of setting value in webedit using DOM'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg96AI8g-6zUTikQWfixbVHoCrDJHs-S9LW3Qz4rjBn4kyxuCKN11-CVsF_IBqu8hY_pID2y_zOignh_y0l1TiAoqmGgGCz9TqAuVPUrBo-RBTnzoqkJVile-QBAJjqEJYYc4laGMgt1g/s72-c/Error.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-95473252781089474</id><published>2010-08-06T10:18:00.000-07:00</published><updated>2011-09-30T11:15:51.494-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hyper Link Excelsheet Workbooks Worksheet QTP and Excel"/><title type='text'>Adding Hyperlink In An Excel Sheet</title><content type='html'>&lt;strong&gt;&lt;em&gt;Method #1&lt;/em&gt;&lt;/strong&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Set obj=CreateObject(&quot;Excel.Application&quot;)&lt;br /&gt;obj.Visible=True&lt;br /&gt;&lt;br /&gt;Set oWorkBooks=obj.WorkBooks.Open(&quot;C:\Desktop\Book1.xls&quot;)&lt;br /&gt;Set oWorksheet=oWorkBooks.Worksheets(1)&lt;br /&gt;&lt;br /&gt;With oWorksheet&lt;br /&gt;.Hyperlinks.Add .Range(&quot;A1&quot;),&quot;http://qtpcodes.blogspot.com&quot;&lt;br /&gt;End With&lt;br /&gt;&lt;/pre&gt;&lt;strong&gt;&lt;em&gt;Method #2&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Set obj=CreateObject(&quot;Excel.Application&quot;)&lt;br /&gt;obj.Visible=True&lt;br /&gt;&lt;br /&gt;Set oWorkBooks=obj.WorkBooks.Open(&quot;C:\Desktop\Book1.xls&quot;)&lt;br /&gt;Set oWorksheet=oWorkBooks.Worksheets(1)&lt;br /&gt;sLink=&quot;http://www.qtpcodes.blogspot.com&quot;&lt;br /&gt;&lt;br /&gt;oWorksheet.Cells(1, 1).Value= &quot;=HYPERLINK(&quot;&amp;amp;Chr(34)&amp;amp;sLink&amp;amp;Chr(34)&amp;amp;&quot;,&quot;&quot;CLICK HERE&quot;&quot;)&quot;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/95473252781089474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/08/adding-hyperlink-in-excel-sheet.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/95473252781089474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/95473252781089474'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/08/adding-hyperlink-in-excel-sheet.html' title='Adding Hyperlink In An Excel Sheet'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-8020780371783287638</id><published>2010-06-26T21:23:00.000-07:00</published><updated>2011-09-30T08:10:13.702-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Resize Bitmap Using QTP DotNetFactory System.Drawing.Image"/><title type='text'>Resizing Bitmap using Dotnet Factory</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;&lt;br /&gt;Set oImage=DotNetFactory.CreateInstance(&quot;System.Drawing.Image&quot;,&quot;System.Drawing&quot;) &lt;br /&gt;vstPath=&quot;C:\Sample Pictures\Water lilies.jpg&quot; &#39;path of the bitmap to be resized. &lt;br /&gt;Set oBitmap=DotNetFactory.CreateInstance(&quot;System.Drawing.Bitmap&quot;,&quot;System.Drawing&quot;,oImage.FromFile(vstPath),30,40) &lt;br /&gt;vStResizedPath=&quot;C:\Sample Pictures\Water lilies1.jpg&quot; &lt;br /&gt;oBitmap.Save(vStResizedPath)&#39;Save the resized bitmap. &lt;br /&gt;Set oBitmap=Nothing &lt;br /&gt;Set oImage=Nothing&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/8020780371783287638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/06/resizing-bitmap-using-dotnet-factory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/8020780371783287638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/8020780371783287638'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/06/resizing-bitmap-using-dotnet-factory.html' title='Resizing Bitmap using Dotnet Factory'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-8441481251765194144</id><published>2010-06-03T10:36:00.000-07:00</published><updated>2011-09-30T20:43:05.801-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB Script Class QTP Code Reuse Object Function"/><title type='text'>Reuse Your QTP Code</title><content type='html'>In this article, I am going to explain you how can we reuse the code which is written for web application.&lt;br&gt;In the below class, I have written function fnc_set to set value in a WebEdit.&lt;br&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Class FirstClass&lt;br /&gt;Private VarBrowserObj&lt;br /&gt;Private VarWebEditObj&lt;br /&gt;Private VarSetValue&lt;br /&gt;&#39;**********Let Property*****************************************&lt;br /&gt;Public Property Let fnc_VarSetValue(val)&lt;br /&gt;VarSetValue=val&lt;br /&gt;End Property&lt;br /&gt;&#39;**********Set Property****************************************&lt;br /&gt;Public Property Set fnc_VarBrowserObj(val)&lt;br /&gt;Set VarBrowserObj=val&lt;br /&gt;End Property&lt;br /&gt;&lt;br /&gt;Public Property Set fnc_VarWebEditObj(val)&lt;br /&gt;Set VarWebEditObj=val&lt;br /&gt;End Property&lt;br /&gt;&#39;**************Funtions and Procedures**********************&lt;br /&gt;Public Function fnc_set&lt;br /&gt;Browser(VarBrowserObj).WebEdit(VarWebEditObj).Set VarSetValue&lt;br /&gt;End Function&lt;br /&gt;End Class&lt;/pre&gt;&lt;br&gt;Here, I am creating an object for the above class and setting up values and objects for class properties.&lt;br&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Public objClass&lt;br /&gt;&#39;Creating object for class&lt;br /&gt;Set objClass=new FirstClass &lt;br /&gt;&lt;br /&gt;&#39;Calling Let to assign value for VarSetValue property&lt;br /&gt;objClass.fnc_VarSetValue=&quot;QTP&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&#39;Calling Set property method for Browser object&lt;br /&gt;Dim objBrowser:Set objBrowser=Description.Create()&lt;br /&gt;objBrowser(&quot;name&quot;).Value=&quot;Google&quot;&lt;br /&gt;Set objClass.fnc_VarBrowserObj=objBrowser&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&#39;Calling Set property method for WebEdit object&lt;br /&gt;Dim objWebEdit:Set objWebEdit=Description.Create()&lt;br /&gt;objWebEdit(&quot;name&quot;).Value=&quot;q&quot;&lt;br /&gt;Set objClass.fnc_VarWebEditObj=objWebEdit&lt;br /&gt;&lt;br /&gt;&#39;Calling fnc_set function for Web operation&lt;br /&gt;objClass.fnc_set&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;You may think that the above class can be used only for web application. But we are able to use for other application also.&lt;br&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;&#39;Calling Let to assign value for VarSetValue property&lt;br /&gt;objClass.fnc_VarSetValue=&quot;mercury&quot;&lt;br /&gt;&lt;br /&gt;&#39;Calling Set property method for Dialog object&lt;br /&gt;Dim objDialog:Set objDialog=Description.Create()&lt;br /&gt;objDialog(&quot;text&quot;).Value=&quot;Login&quot;&lt;br /&gt;objDialog(&quot;micclass&quot;).Value=&quot;Dialog&quot;&#39;Here is the trick, you need to inlcude micclass property along with main property.&lt;br /&gt;Set objClass.fnc_VarBrowserObj=objDialog&lt;br /&gt;&lt;br /&gt;&#39;Calling Set property method for WinEdit object&lt;br /&gt;Dim objWinEdit:Set objWinEdit=Description.Create()&lt;br /&gt;objWinEdit(&quot;attached text&quot;).Value=&quot;Agent Name:&quot;&lt;br /&gt;objWinEdit(&quot;micclass&quot;).Value=&quot;WinEdit&quot;&lt;br /&gt;Set objClass.fnc_VarWebEditObj=objWinEdit&lt;br /&gt;&lt;br /&gt;objClass.fnc_set &#39;Setting value in winedit with same function.&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/8441481251765194144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/06/reuse-your-qtp-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/8441481251765194144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/8441481251765194144'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/06/reuse-your-qtp-code.html' title='Reuse Your QTP Code'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-3783514571754827795</id><published>2010-05-31T09:39:00.000-07:00</published><updated>2011-10-01T07:24:17.889-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP RegisterUserFunc GetRowWithCellText Webtable"/><title type='text'>Overriding GetRowWithCellText Method</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span&gt;&lt;strong&gt;GetRowWithCellText&lt;/strong&gt; method finds the specified text in a webtable and returns the number of the first row found. &lt;/span&gt;&lt;br&gt;&lt;span&gt;If you want to find all matches in a webtable, then we have to override the &lt;strong&gt;GetRowWithCellText&lt;/strong&gt; method using RegisterUserFunc as below,&lt;/span&gt;&lt;/span&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;RegisterUserFunc &quot;WebTable&quot;,&quot;GetRowWithCellText&quot;,&quot;NewGetRowWithCellText&quot;&lt;br /&gt;&lt;/pre&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;&lt;br /&gt;Function NewGetRowWithCellText(obj,val1,val2,val3)&lt;br /&gt;Dim v_st_returnText&lt;br /&gt;Set objRow=obj.Object.getElementsByTagName(&quot;TR&quot;)&lt;br /&gt;If val2&amp;lt;&amp;gt;0 Then val2=val2-1&lt;br /&gt;If val3&amp;lt;&amp;gt;0 Then val3=val3-1&lt;br /&gt;For i=val3 to objRow.Length-1&lt;br /&gt;If val1=Trim(objRow(i).getElementsByTagName(&quot;TD&quot;)(val2).InnerText) Then&lt;br /&gt;If v_st_returnText=&quot;&quot; Then&lt;br /&gt;v_st_returnText=Cstr( i+1)&lt;br /&gt;Else&lt;br /&gt;v_st_returnText=Cstr( i+1)+&quot;,&quot;+v_st_returnText&lt;br /&gt;End If&lt;br /&gt;End If&lt;br /&gt;Next&lt;br /&gt;NewGetRowWithCellText=v_st_returnText&lt;br /&gt;End Function&lt;/pre&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;&lt;br /&gt;Msgbox Browser(&quot;name:=QTP Codes&quot;).Page(&quot;title:=QTP Codes&quot;).WebTable(&quot;index:=0&quot;).GetRowWithCellText(&quot;Cell3&quot;,1,1)&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/3783514571754827795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/05/overriding-getrowwithcelltext-method.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/3783514571754827795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/3783514571754827795'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/05/overriding-getrowwithcelltext-method.html' title='Overriding GetRowWithCellText Method'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-1861823567138416564</id><published>2010-05-15T09:00:00.000-07:00</published><updated>2011-10-01T07:33:36.558-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel Application QTP GetObject CreateObject Quit Excel Application Workbooks"/><title type='text'>Quitting Excel Workbooks Using Getobject</title><content type='html'>&lt;span&gt;Let’s consider that we have opened two excel workbooks using CreateObject. If you want to quit those two workbooks, try the below snippet.&lt;/span&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Function fnc_CreateExcel&lt;br /&gt;Set objNewExcel=CreateObject(&quot;Excel.Application&quot;)&lt;br /&gt;objNewExcel.Visible=True&lt;br /&gt;objNewExcel.Workbooks.Add&lt;br /&gt;Set objNewExcel=Nothing&lt;br /&gt;End Function&lt;br /&gt;&lt;/pre&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;&lt;br /&gt;Call fnc_CreateExcel&#39;Creating Book1&lt;br /&gt;Call fnc_CreateExcel&#39;Creating Book2&lt;br /&gt;&lt;/pre&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;&lt;br /&gt;Call fnc_Quit_Excel(&quot;Book1&quot;)&#39;Quitting Book 1&lt;br /&gt;Call fnc_Quit_Excel(&quot;Book2&quot;)&#39;Quitting Book 2&lt;br /&gt;&lt;/pre&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;&lt;br /&gt;Function fnc_Quit_Excel(v_St_ExcelName)&lt;br /&gt;Set objExcel=GetObject(v_St_ExcelName).Application&#39;Getting Excel Object using Book name&lt;br /&gt;objExcel.Quit&lt;br /&gt;Set objExcel=Nothing&lt;br /&gt;End Function&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/1861823567138416564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/05/quitting-excel-workbooks-using.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/1861823567138416564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/1861823567138416564'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/05/quitting-excel-workbooks-using.html' title='Quitting Excel Workbooks Using Getobject'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-5670154772423739222</id><published>2010-04-30T09:35:00.000-07:00</published><updated>2011-10-09T18:54:08.559-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP Bitmap Capture Bitmap Highlight Text In QTP"/><title type='text'>Capturing Bitmap When Text Is Mismatched</title><content type='html'>Whenever a text in a webpage is mismatched, you may use QTP report event to report the failure.&lt;br /&gt;You can try the below snippet along with report event, the code captures and highlights the mismatched text in the webpage.&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Set obj=Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;).Object.getElementsByTagName(&quot;LABEL&quot;)(0)&lt;br /&gt;vStrActualText= obj.innerText&lt;br /&gt;vStrExpectedText=&quot;The Web&quot;&lt;br /&gt;If vStrActualText&amp;lt;&amp;gt;vStrExpectedText Then&lt;br /&gt;obj.innerHTML=&quot;&lt;span style=&quot;&quot;&gt;&quot;&amp;amp;vStrActualText&amp;amp;&quot;&lt;/span&gt;&quot;&lt;br /&gt;Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;).highlight&lt;br /&gt;Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;).CaptureBitmap &quot;C:\TEST.PNG&quot;,True&lt;br /&gt;obj.innerHTML=vStrActualText&lt;br /&gt;End If&lt;/pre&gt;&lt;span &gt;If your text is mismatched in the webpage, the script captures  bitmap of the page.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizvQ2xrsuenrHckH2o_DvWMHYMix00-jWvdPELOZQBvIhBTx-y3MswJ2hyphenhyphenSGif3VkaU9Blou7TeCyg4ckA_xVpPkSUsB-9U2OogRgl5QTTv7yyrJRdks5tduPxzvMdTC2SuWqjZ87BTw/s1600/TEST.PNG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5465970601898128530&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 189px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizvQ2xrsuenrHckH2o_DvWMHYMix00-jWvdPELOZQBvIhBTx-y3MswJ2hyphenhyphenSGif3VkaU9Blou7TeCyg4ckA_xVpPkSUsB-9U2OogRgl5QTTv7yyrJRdks5tduPxzvMdTC2SuWqjZ87BTw/s400/TEST.PNG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/5670154772423739222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/04/capturing-bitmap-when-text-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/5670154772423739222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/5670154772423739222'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/04/capturing-bitmap-when-text-is.html' title='Capturing Bitmap When Text Is Mismatched'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizvQ2xrsuenrHckH2o_DvWMHYMix00-jWvdPELOZQBvIhBTx-y3MswJ2hyphenhyphenSGif3VkaU9Blou7TeCyg4ckA_xVpPkSUsB-9U2OogRgl5QTTv7yyrJRdks5tduPxzvMdTC2SuWqjZ87BTw/s72-c/TEST.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-2456114210813439911</id><published>2010-04-17T20:02:00.000-07:00</published><updated>2011-10-01T08:15:48.466-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DOM Webradiogroup DOM Radio Button Radio Button Disabled"/><title type='text'>Finding Disabled Radio Buttons</title><content type='html'>&lt;span  &gt;The below snippet finds disabled radio button from a webradiogroup using DOM.&lt;/span&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Set obj= Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;).Object.getElementsByName(&quot;meta&quot;)&lt;br /&gt;For i=0 to obj.Length-1&lt;br /&gt;If obj(i).Type=&quot;radio&quot; and obj(i).Disabled=&quot;True&quot; Then&lt;br /&gt;Msgbox &quot;Radio &quot; &amp;amp;i+1&amp;amp; &quot; is disabled&quot; &#39;This msgbox indicates the disabled radio button.&lt;br /&gt;End if&lt;br /&gt;Next&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/2456114210813439911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/04/finding-disabled-radio-buttons.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2456114210813439911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2456114210813439911'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/04/finding-disabled-radio-buttons.html' title='Finding Disabled Radio Buttons'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-6395414940883868098</id><published>2010-04-17T19:03:00.000-07:00</published><updated>2011-09-30T21:55:19.965-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="QTP Screen Changing Screen Resolution Qres MultiRes"/><title type='text'>Changing Screen Resolution at Runtime</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span&gt;So far I have not found a code for changing screen resolution at runtime using vb script. If anyone finds that, please post it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;An alternative solution, we can go for third party tool like Qres and MultiRes. These tools can be operated using QTP at runtime.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;strong&gt;Download Links:&lt;/strong&gt;&lt;br /&gt;Qres: &lt;/span&gt;&lt;a href=&quot;http://home.no/aksoftware/&quot;&gt;&lt;span&gt;http://home.no/aksoftware/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span&gt;MultiRes: &lt;/span&gt;&lt;a href=&quot;http://www.entechtaiwan.com/util/multires.shtm&quot;&gt;&lt;span&gt;http://www.entechtaiwan.com/util/multires.shtm&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;If you know any other tool(s), please don’t hesitate to include in the comment section.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/6395414940883868098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/04/changing-screen-resolution-at-runtime.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/6395414940883868098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/6395414940883868098'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/04/changing-screen-resolution-at-runtime.html' title='Changing Screen Resolution at Runtime'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-2904060253584261882</id><published>2010-03-30T18:03:00.000-07:00</published><updated>2011-10-01T08:18:19.988-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS for QTP"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Table Display."/><category scheme="http://www.blogger.com/atom/ns#" term="Webtable"/><category scheme="http://www.blogger.com/atom/ns#" term="Webtable Border"/><title type='text'>Do You Want To View Your Web Table&#39;s Structure?</title><content type='html'>&lt;span&gt;Do you want to view your web table&#39;s structure? If the answer is Yes, then try the below snippet.&lt;/span&gt;&lt;pre name=&quot;code&quot; class=&quot;vb&quot;&gt;Set objTable=Browser(&quot;name:=Google&quot;).Page(&quot;title:=Google&quot;).WebTable(&quot;name:=q&quot;).Object&lt;br /&gt;strTRCount=objTable.getElementsByTagName(&quot;TD&quot;).Length-1&lt;br /&gt;For i=0 to strTRCount&lt;br /&gt;objTable.getElementsByTagName(&quot;TD&quot;)(i).style.borderstyle=&quot;solid&quot;&lt;br /&gt;objTable.getElementsByTagName(&quot;TD&quot;)(i).style.borderwidth=&quot;2px&quot;&lt;br /&gt;objTable.getElementsByTagName(&quot;TD&quot;)(i).style.bordercolor=&quot;#98bf21&quot;&lt;br /&gt;Next&lt;br /&gt;&lt;/pre&gt;&lt;span&gt;Try the above code with Google page, you will get the output as below.&lt;/span&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAK-UcdEZAMTAcl81xeeyPlvbkNyk9OdZ6GlTbg2a-uNluKQ9KqbVOMSPWws10SATcFT3u8CZB1_jou8U1wNB_tchmJyxToF1XAf_mg68zBrHVoTzTpvhon-jzI8LYLQI9k8EGhVPqYQ/s1600/Img11.bmp&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5454599264191856642&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 146px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAK-UcdEZAMTAcl81xeeyPlvbkNyk9OdZ6GlTbg2a-uNluKQ9KqbVOMSPWws10SATcFT3u8CZB1_jou8U1wNB_tchmJyxToF1XAf_mg68zBrHVoTzTpvhon-jzI8LYLQI9k8EGhVPqYQ/s400/Img11.bmp&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-size:85%;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Now, you are able to view all the cells of the webtable. &lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/2904060253584261882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/do-you-want-to-view-your-web-tables.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2904060253584261882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/2904060253584261882'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/do-you-want-to-view-your-web-tables.html' title='Do You Want To View Your Web Table&#39;s Structure?'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAK-UcdEZAMTAcl81xeeyPlvbkNyk9OdZ6GlTbg2a-uNluKQ9KqbVOMSPWws10SATcFT3u8CZB1_jou8U1wNB_tchmJyxToF1XAf_mg68zBrHVoTzTpvhon-jzI8LYLQI9k8EGhVPqYQ/s72-c/Img11.bmp" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-4507890588830187555</id><published>2010-03-27T05:29:00.000-07:00</published><updated>2011-10-01T08:27:59.220-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array List."/><category scheme="http://www.blogger.com/atom/ns#" term="Weblist"/><category scheme="http://www.blogger.com/atom/ns#" term="Weblist Sorting"/><title type='text'>How To Check Elements In A Weblist Are In Alphabetical Order</title><content type='html'>&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;arrCtry=Split(Browser(&quot;name:=QTP&quot;).Page(&quot;title:=QTP&quot;).WebList(&quot;name:=select1&quot;).GetROProperty(&quot;all items&quot;),&quot;;&quot;)&lt;br /&gt;&lt;br /&gt;Set objArray=DotNetFactory.CreateInstance(&quot;System.Collections.ArrayList&quot;,&quot;&quot;)&lt;br /&gt;&lt;br /&gt;For i=0 to Ubound(arrCtry)&lt;br /&gt;If arrCtry(i)&lt;&gt;&quot;--Choose One--&quot; Then&lt;br /&gt;objArray.Add(arrCtry(i))&lt;br /&gt;End If&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;objArray.Sort()&lt;br /&gt;objArray.Insert 0,&quot;--Choose One--&quot;&lt;br /&gt;&lt;br /&gt;For j=0 to Ubound(arrCtry)&lt;br /&gt;strOuput=strOuput+objArray(j)&lt;br /&gt;strOuput=strOuput+&quot;;&quot;&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;If strOuput=Browser(&quot;name:=QTP&quot;).Page(&quot;title:=QTP&quot;).WebList(&quot;name:=select1&quot;).GetROProperty(&quot;all items&quot;)+&quot;;&quot; Then&lt;br /&gt;Msgbox &quot;The Weblist&#39;s values are sorted in alphabetical order&quot;&lt;br /&gt;Else&lt;br /&gt;Msgbox &quot;The Weblist&#39;s values are not sorted in alphabetical order&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;I hope the above snippet is useful.</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/4507890588830187555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/how-to-check-elements-in-weblist-are-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/4507890588830187555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/4507890588830187555'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/how-to-check-elements-in-weblist-are-in.html' title='How To Check Elements In A Weblist Are In Alphabetical Order'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-4651477944659929231</id><published>2010-03-14T08:06:00.000-07:00</published><updated>2011-10-01T08:32:00.620-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Code Creator."/><category scheme="http://www.blogger.com/atom/ns#" term="WMI"/><category scheme="http://www.blogger.com/atom/ns#" term="WMI for QTP"/><title type='text'>Use WMI Code Creator Tool for Quick WMI Scripting</title><content type='html'>&lt;span&gt;Are you searching for WMI codes? Or do you want to know about WMI classes and properties?&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span&gt;Microsoft has created an application to reduce our WMI scripting time. That is &lt;strong&gt;WMI Code Creator&lt;/strong&gt;. This is a free tool from Microsoft. You can download it from the below link,&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;amp;displaylang=en&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;amp;displaylang=en&lt;/span&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;span&gt;This tool reduces our WMI scripting time. &lt;/span&gt;&lt;br&gt;&lt;span&gt;If anyone uses this tool, please include your comments. It may encourage QTP developers to opt this tool for quick WMI scripting.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/4651477944659929231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/use-wmi-code-creator-tool-for-quick-wmi.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/4651477944659929231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/4651477944659929231'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/use-wmi-code-creator-tool-for-quick-wmi.html' title='Use WMI Code Creator Tool for Quick WMI Scripting'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-742691033314168805</id><published>2010-03-12T02:39:00.000-08:00</published><updated>2011-10-01T08:44:01.084-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ChildItem and ChildItemCount methods"/><category scheme="http://www.blogger.com/atom/ns#" term="Webedit"/><category scheme="http://www.blogger.com/atom/ns#" term="Webtable"/><title type='text'>Working with ChildItem and ChildItemCount methods</title><content type='html'>&lt;span&gt;Consider a webtable has one row and two columns and the second column contains a webedit.&lt;/span&gt;&lt;br&gt;&lt;span&gt;If you run the below code, Exist method will be passed and the value will be set into webedit.&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;If obj.ChildItem(1,2,&quot;WebEdit&quot;,0).Exist(0) Then &lt;br /&gt;obj.ChildItem(1,2,&quot;WebEdit&quot;,0).Set &quot;QTP&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;&lt;span&gt;Suppose, if you run the code for negative condition (I.e. You are going to look for webedit in the first column where it does not exist), you will get an error as same as below.&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULWsa5YVPrpbg8y8tc6xfhis6-TvXJan4_82HfS2SMr3Wlq3nD9RuLjmMRNxCdLK7-nLnjErQ2BPTtmhNn8B4UEAxNyXIpyPx9WxriGP8JbRXOMUiwUCIK9Hqa54T5Y22h0mudZOAYQ/s1600-h/3-12-2010+3-58-03+PM.png&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5447695432408089602&quot; style=&quot;DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 375px; CURSOR: hand; HEIGHT: 118px; TEXT-ALIGN: center&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULWsa5YVPrpbg8y8tc6xfhis6-TvXJan4_82HfS2SMr3Wlq3nD9RuLjmMRNxCdLK7-nLnjErQ2BPTtmhNn8B4UEAxNyXIpyPx9WxriGP8JbRXOMUiwUCIK9Hqa54T5Y22h0mudZOAYQ/s400/3-12-2010+3-58-03+PM.png&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br&gt;&lt;span&gt;To avoid this problem, use ChildItemCount method instead of ChildItem for the above criteria.&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;If obj.ChildItemCount(1,1,&quot;WebEdit&quot;)&gt;0 Then&lt;br /&gt;obj.ChildItem(1,1,&quot;WebEdit&quot;,0).Set &quot;QTP&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;&lt;span&gt;Now, you do not get the error for negative case.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/742691033314168805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/working-with-childitem-and.html#comment-form' title='81 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/742691033314168805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/742691033314168805'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/03/working-with-childitem-and.html' title='Working with ChildItem and ChildItemCount methods'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULWsa5YVPrpbg8y8tc6xfhis6-TvXJan4_82HfS2SMr3Wlq3nD9RuLjmMRNxCdLK7-nLnjErQ2BPTtmhNn8B4UEAxNyXIpyPx9WxriGP8JbRXOMUiwUCIK9Hqa54T5Y22h0mudZOAYQ/s72-c/3-12-2010+3-58-03+PM.png" height="72" width="72"/><thr:total>81</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4461730588425548224.post-713895487948311709</id><published>2010-02-23T23:23:00.000-08:00</published><updated>2011-10-01T08:54:11.806-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GUID"/><category scheme="http://www.blogger.com/atom/ns#" term="Random Strings"/><category scheme="http://www.blogger.com/atom/ns#" term="Random Test Data"/><title type='text'>Generating Random Data</title><content type='html'>&lt;span&gt;Do you want to generate random data for your test? Try the below methods.&lt;/span&gt;&lt;br&gt;&lt;span&gt;&lt;b&gt;&lt;i&gt;Method #1:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Set objRandm = CreateObject(&quot;Scriptlet.TypeLib&quot;)&lt;br /&gt;strGUID = objRandm.Guid&lt;br /&gt;Msgbox strGUID&lt;/pre&gt;&lt;br&gt;&lt;span&gt;&lt;b&gt;&lt;i&gt;Method #2:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Set oGuid=DotNetFactory.CreateInstance(&quot;System.Guid&quot;,&quot;mscorlib&quot;)&lt;br /&gt;Set oConvert=DotNetFactory.CreateInstance(&quot;System.Convert&quot;,&quot;mscorlib&quot;)&lt;br /&gt;&lt;br /&gt;temp= oConvert.ToBase64String(oGuid.NewGuid().ToByteArray())&lt;br /&gt;temp=Left(temp,22)&lt;br /&gt;temp=Replace(temp,&quot;/&quot;, &quot;_&quot;)&lt;br /&gt;strRandm=Replace(temp,&quot;+&quot;, &quot;-&quot;)&lt;br /&gt;Msgbox strRandm&lt;br /&gt;&lt;/pre&gt;&lt;span&gt;This method is as same as previous one, but length of the string is shorter.&lt;/span&gt;&lt;br&gt;&lt;span&gt;&lt;b&gt;&lt;i&gt;Method #3:&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;pre class=&quot;vb&quot; name=&quot;code&quot;&gt;&lt;br /&gt;Msgbox hex(( ( (timer+rnd(1)) *100) + int(rnd(1)*16)*&amp;hf0000 ) mod &amp;h100000 )&lt;br /&gt;&lt;/pre&gt;&lt;span&gt;The above code generates semi-unique random strings.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtpcodes.blogspot.com/feeds/713895487948311709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtpcodes.blogspot.com/2010/02/generating-random-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/713895487948311709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4461730588425548224/posts/default/713895487948311709'/><link rel='alternate' type='text/html' href='http://qtpcodes.blogspot.com/2010/02/generating-random-data.html' title='Generating Random Data'/><author><name>Asiq Ahamed</name><uri>http://www.blogger.com/profile/10131060151146448324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>