<?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-527288555548534823</id><updated>2025-05-26T16:01:01.235-07:00</updated><category term="Software Gyan"/><title type='text'>Working in Automation Testing</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-6269362855573585402</id><published>2013-01-30T08:30:00.000-08:00</published><updated>2013-01-30T08:30:12.843-08:00</updated><title type='text'>How to check if a process is still running in your windows</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Many times your script need to know if a program or for example a bat file is still running. so, how you can check it using VBScript.&lt;br /&gt;
&lt;br /&gt;
Below is the code which you can use to check if a process/program is still running&lt;br /&gt;
&lt;br /&gt;
sub p_check()&lt;br /&gt;
with createobject(&quot;shell.application&quot;)&lt;br /&gt;
&amp;nbsp;for each wndw in .windows&lt;br /&gt;
&amp;nbsp; &amp;nbsp;locationurl_ = cstr(wndw.LocationURL)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;if InStr(locationurl_, &quot;locationurl&quot;) = 0 then&lt;br /&gt;
&#39;here in locationurl you can pass the name of the bat file&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
else&lt;br /&gt;
&#39;to quit the bat file if needed after script found it&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;wndw.quit&lt;br /&gt;
end if&lt;br /&gt;
next&lt;br /&gt;
end with&lt;br /&gt;
End sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, using wndw object in for each loop you can check the process based on its application name as well in which it is open for example iexplorer but you need to use correct method to get values based on your need&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/6269362855573585402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2013/01/how-to-check-if-process-is-still.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/6269362855573585402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/6269362855573585402'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2013/01/how-to-check-if-process-is-still.html' title='How to check if a process is still running in your windows'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-7067231820709503469</id><published>2013-01-30T07:42:00.001-08:00</published><updated>2013-01-30T07:57:44.677-08:00</updated><title type='text'>Reading and writing in XML using QTP - Vbscript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Using VbScript one can read and write into an XML file by creating an object of &quot;Msxml2.DOMDocument&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMJR9h9efv8qYt5CvSta1ijJqNKfYRLjrB1_DB566GW_U-QY_BJPp18O7QV6PeTm8RyyvrcgRIqUAtsfTPdo5moBqV6lsXyZm152ZT7f6qVUGighZeeI024ttyncj0A4TlPa-qNfJsQx5d/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMJR9h9efv8qYt5CvSta1ijJqNKfYRLjrB1_DB566GW_U-QY_BJPp18O7QV6PeTm8RyyvrcgRIqUAtsfTPdo5moBqV6lsXyZm152ZT7f6qVUGighZeeI024ttyncj0A4TlPa-qNfJsQx5d/s1600/Untitled.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If one needs to read or write into this XML file, then it can be done using the below procedure where I have used &quot;object_&quot; and &quot;data_file_path&quot; as parameter.&lt;/div&gt;
&lt;/div&gt;
1. object_ can be &quot;_path&quot; if you want to get values inside &quot;_path&quot; tag in above XML&lt;br /&gt;
2. data_file_path is XML file path like &quot;c:\data.xml&quot;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Sub Write_read_XML(object_, data_file_path)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;i&gt;&#39;creating object for &quot;Msxml2.DOMDocument&quot;&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Set xmlDoc = CreateObject(&quot;Msxml2.DOMDocument&quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&#39;load xml file on object&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlDoc.load(data_file_path)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&#39;creating an object which can store all values in tag: like in this case all the values inside object_ tag will be saved in ElemList&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Set ElemList = xmlDoc.getElementsByTagName(object_)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&#39;Now loop through all the tags with name object_ in your XML file&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for n = 0 to 1&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;Now to fetch value you can use:&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;msgbox ElemList.item(n).text&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;Incase you need to save values in XML then you can use the code:&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ElemList.item(n).text = &quot;value &quot; &amp;amp; cstr(n)&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;next&lt;/div&gt;
&lt;b&gt;End Sub&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/7067231820709503469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2013/01/reading-and-writing-in-xml-using-qtp.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/7067231820709503469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/7067231820709503469'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2013/01/reading-and-writing-in-xml-using-qtp.html' title='Reading and writing in XML using QTP - Vbscript'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMJR9h9efv8qYt5CvSta1ijJqNKfYRLjrB1_DB566GW_U-QY_BJPp18O7QV6PeTm8RyyvrcgRIqUAtsfTPdo5moBqV6lsXyZm152ZT7f6qVUGighZeeI024ttyncj0A4TlPa-qNfJsQx5d/s72-c/Untitled.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-4652762824099826912</id><published>2011-11-17T01:41:00.000-08:00</published><updated>2011-11-17T01:42:34.846-08:00</updated><title type='text'>Using DOM in QTP</title><content type='html'>DOM (Document Object Method) is a method for QTP engineers to access the source of any webpage direct through VB Scripting.&lt;br /&gt;&lt;br /&gt;Using the DOM we can find an object on a web page and then can perform any action like click, set values etc.&lt;br /&gt;&lt;br /&gt;For example if you need to check total links on a web browser, then you can use the following code:&lt;br /&gt;&lt;br /&gt;Set Links = Browser(&quot;Google&quot;).Page(&quot;Google&quot;).Object.all.tags(&quot;a&quot;)&lt;br /&gt;Msgbox &quot;Total links: &quot; &amp; Links.Length&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or you can also use the following code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Set Links = Browser(&quot;Google&quot;).Page(&quot;Google&quot;).Object.Links&lt;br /&gt;Msgbox &quot;Total links: &quot; &amp; Links.Length&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here, Object property of Page object is used where it represents the HTML document in a given browser. This browser contains links and other objects too. Here, I have used Length property to get the number of items in a collection.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using DOM object we can also find the object on the web page by using the methods like GetElementsByTagName, GetElementByID and more and then perform operations on it.&lt;br /&gt;&lt;br /&gt;eg. &lt;br /&gt;&lt;br /&gt;we can set value in textbox by using the getElementByID method on browser:&lt;br /&gt;&lt;br /&gt;Browser(&quot;Google&quot;).Page(&quot;Google&quot;).Object.getElementByID(&quot;webeditname&quot;).Value=&quot;Testing&quot;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/4652762824099826912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2011/11/using-dom-in-qtp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/4652762824099826912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/4652762824099826912'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2011/11/using-dom-in-qtp.html' title='Using DOM in QTP'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-292494831587593720</id><published>2011-04-02T19:57:00.000-07:00</published><updated>2011-04-02T19:59:05.892-07:00</updated><title type='text'>How to get clipboard text using VBScript</title><content type='html'>&#39; Open notepad&lt;br /&gt;Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)&lt;br /&gt;WshShell.Run &quot;notepad&quot;, 9&lt;br /&gt;&lt;br /&gt;&#39; Give Notepad time to load&lt;br /&gt;WScript.Sleep 500&lt;br /&gt;&lt;br /&gt;&#39; Do The Paste&lt;br /&gt;WshShell.SendKeys &quot;%e&quot;&lt;br /&gt;WshShell.SendKeys &quot;p&quot;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/292494831587593720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2011/04/how-to-get-clipboard-text-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/292494831587593720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/292494831587593720'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2011/04/how-to-get-clipboard-text-using.html' title='How to get clipboard text using VBScript'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-1885625663165009131</id><published>2010-06-29T22:07:00.000-07:00</published><updated>2010-06-29T22:34:40.643-07:00</updated><title type='text'>How to handle null strings</title><content type='html'>In TestComplete whenever DDT diver or array or anything returns null or nothing instead of a string value then it gives error message.  For example if you are fetching values using the DDT driver as follow it will return you the data string from the excel file if the value exists:&lt;div&gt;&lt;br /&gt;&lt;div&gt;&#39;path is the path of axcel file&lt;/div&gt;&lt;div&gt;&#39;sheet is the sheet ID of excel file&lt;/div&gt;&lt;div&gt;&#39;A is the column name in excel file&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;set inputdata =   DDT.ExcelDriver(path,sheet)   &lt;/div&gt;&lt;div&gt;name = inputData.value(&quot;A&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In case if it does not exists then, it will trough an error/exception. You can handle it versy easily by using &amp;amp;&quot;&quot; with the string.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;set inputdata =   DDT.ExcelDriver(path,sheet)   &lt;/div&gt;&lt;div&gt;name = inputData.value(&quot;A&quot;) &amp;amp;&quot;&quot;    &#39;this will add nothing but will remove the exception you are getting.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/1885625663165009131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2010/06/how-to-handle-null-strings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/1885625663165009131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/1885625663165009131'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2010/06/how-to-handle-null-strings.html' title='How to handle null strings'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-7656678568938699238</id><published>2010-06-29T21:35:00.000-07:00</published><updated>2010-06-29T22:02:47.442-07:00</updated><title type='text'>How to use Regular Expression to test Email ID and other strings</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;A regular expression can be used as follow:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;Here x is the string that needed to be tested and y is the pattern against which x will be tested&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;Function RegExpression(x,y)&lt;/div&gt;&lt;div&gt;Dim reg&lt;/div&gt;&lt;div&gt;Set reg = New RegExp&lt;/div&gt;&lt;div&gt;reg.Pattern = y &#39; Regular Expression filter&lt;/div&gt;&lt;div&gt;reg.IgnoreCase = True  &#39;ignoring the case sensitive&lt;/div&gt;&lt;div&gt;RegExpression = reg.Test(x) &#39; Test the captured value against  the filter&lt;/div&gt;&lt;div&gt;End Function&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;The above function can be used in the main procedure as:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Sub RegularExpression&lt;/div&gt;&lt;div&gt;x = &quot;0.10&quot; &#39; Captured value&lt;/div&gt;&lt;div&gt;y = &quot;0[.]10&quot; &#39; Regular expression filter and expected value&lt;/div&gt;&lt;div&gt;z = RegExpression(x,y) &#39; Call the function&lt;/div&gt;&lt;div&gt;if z = -1 then&lt;/div&gt;&lt;div&gt;log.message &quot;The value is valid&quot;&lt;/div&gt;&lt;div&gt;else&lt;/div&gt;&lt;div&gt;log.error &quot;The value is not valid&quot;&lt;/div&gt;&lt;div&gt;end if&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;An email ID can be tested with Regular expression using the above function by passing the following patern:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;here y can change as per the characters allowed in the email ID &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Sub RegularExpression&lt;/div&gt;&lt;div&gt;x = &quot;abc27@yahoo.com&quot; &#39; Captured value&lt;/div&gt;&lt;div&gt;y = &quot;^[A-Z0-9]+@[A-Z0-9]+.[A-Z]{3}&quot; &#39; Regular expression filter and expected value&lt;/div&gt;&lt;div&gt;z = RegExpression(x,y) &#39; Call the function&lt;/div&gt;&lt;div&gt;if z = -1 then&lt;/div&gt;&lt;div&gt;log.message &quot;The value is valid&quot;&lt;/div&gt;&lt;div&gt;else&lt;/div&gt;&lt;div&gt;log.error &quot;The value is not valid&quot;&lt;/div&gt;&lt;div&gt;end if&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/7656678568938699238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2010/06/how-to-use-regular-expression-to-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/7656678568938699238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/7656678568938699238'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2010/06/how-to-use-regular-expression-to-test.html' title='How to use Regular Expression to test Email ID and other strings'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-2561089792651855222</id><published>2010-06-29T21:28:00.000-07:00</published><updated>2010-06-29T21:33:28.979-07:00</updated><title type='text'>How to get excel row count</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Excel row count can be get by using the following function:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;function get_row_count(path,sheet)&lt;/div&gt;&lt;div&gt;dim inputdata&lt;/div&gt;&lt;div&gt;dim rowc&lt;/div&gt;&lt;div&gt;set inputData =  DDT.ExcelDriver(path, Sheet)&lt;/div&gt;&lt;div&gt;   while not inputdata.EOF&lt;/div&gt;&lt;div&gt;   inputdata.Next&lt;/div&gt;&lt;div&gt;   rowc = rowc+1&lt;/div&gt;&lt;div&gt;   Wend&lt;/div&gt;&lt;div&gt;get_row_count = rowc  &lt;/div&gt;&lt;div&gt;end Function&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/2561089792651855222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2010/06/how-to-get-excel-row-count.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/2561089792651855222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/2561089792651855222'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2010/06/how-to-get-excel-row-count.html' title='How to get excel row count'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-8118058465417738800</id><published>2009-11-25T22:37:00.001-08:00</published><updated>2009-11-25T22:41:27.071-08:00</updated><title type='text'>Testcomplete: To check if the file exists and to delete a file if it exists</title><content type='html'>&lt;div&gt;&lt;b&gt;Below is the vbscript code that can be used to check if the file exists on system or not&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;In below examples: path is the path of file like &quot;c:\text.txt&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sub Main&lt;/div&gt;&lt;div&gt;set fs=createObject(&quot;Scripting.FileSystemObject&quot;)&lt;/div&gt;&lt;div&gt;If not fs.FileExists(path) Then&lt;/div&gt;&lt;div&gt;  Log.Message(&quot;Fail: file does not exist&quot;)&lt;/div&gt;&lt;div&gt;  Else&lt;/div&gt;&lt;div&gt;  Log.Message(&quot;Pass: File exists&quot;)&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Below is the code to delete a file &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sub Delete&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;set fs=createObject(&quot;Scripting.FileSystemObject&quot;)&lt;/div&gt;&lt;div&gt;If not fs.FileExists(path) Then&lt;/div&gt;&lt;div&gt;  Else&lt;/div&gt;&lt;div&gt;    fs.deletefile(path)&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End sub&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/8118058465417738800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-check-if-file-exists.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/8118058465417738800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/8118058465417738800'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-check-if-file-exists.html' title='Testcomplete: To check if the file exists and to delete a file if it exists'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-746914322030570730</id><published>2009-11-24T21:00:00.000-08:00</published><updated>2011-10-04T21:38:50.093-07:00</updated><title type='text'>TestComplete: To get all the sheets name in your excel workbook</title><content type='html'>&lt;div&gt; To get all the sheets name from the excel file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sub Main&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Set p = Sys.WaitProcess(&quot;EXCEL&quot;)&lt;/div&gt;&lt;div&gt;&#39;this will Make sure you close any Excel work book already open&lt;/div&gt;&lt;div&gt;If p.Exists Then&lt;/div&gt;&lt;div&gt;Call p.Terminate()&lt;/div&gt;&lt;div&gt;End If&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;This is setting the driver&lt;/div&gt;&lt;div&gt;Set MsExcel = Sys.OleObject(&quot;Excel.Application&quot;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;This will open you workbook&lt;/div&gt;&lt;div&gt;&#39;Specify the location of your excel file&lt;/div&gt;&lt;div&gt;Call MsExcel.Workbooks.Open(&quot;c:\test.xls&quot;)&lt;/div&gt;&lt;div&gt;MsExcel.Visible = True &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;To Loop through all the sheet&lt;/div&gt;&lt;div&gt;for I = 1 to MsExcel.sheets.Count&lt;/div&gt;&lt;div&gt;&#39;To activate the sheet&lt;/div&gt;&lt;div&gt;msexcel.Sheets(I).Activate&lt;/div&gt;&lt;div&gt;&#39;To get the name of the active sheet&lt;/div&gt;&lt;div&gt;MsgBox(MsExcel.activesheet.name)&lt;/div&gt;&lt;div&gt;Next&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/746914322030570730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-all-sheets-name-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/746914322030570730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/746914322030570730'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-all-sheets-name-in.html' title='TestComplete: To get all the sheets name in your excel workbook'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-9044326203647197074</id><published>2009-11-16T01:29:00.001-08:00</published><updated>2009-11-16T22:17:14.828-08:00</updated><title type='text'>Testcomplete : Data Driven Testing Framework</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Data-driven testing is a framework where test input and output values are read from data files (datapools, ODBC sources, cvs files, Excel files, DAO objects, ADO objects, and such) and are loaded into variables in captured or manually coded scripts. In this framework, variables are used for both input values and output verification values. Navigation through the program, reading of the data files, and logging of test status and information are all coded in the test script.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  line-height: 14px; font-family:Verdana, Arial, Tahoma, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Data-driven testing&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt; means using a single test to verify many different test cases by driving the test with input and expected values from an external data source instead of using the same hard-coded values each time the test runs. This way, you can test how the application handles various input without having a lot of similar tests that only have different data sets.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Verdana, Arial, Tahoma, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; line-height: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Verdana, Arial, Tahoma, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; line-height: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Verdana, Arial, Tahoma, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; line-height: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;To learn how to perform Data Driven testing using Testcomplete, you can view the following video file: &lt;span class=&quot;Apple-style-span&quot;   style=&quot;  line-height: normal; color: rgb(51, 51, 51); white-space: nowrap; font-family:&#39;trebuchet ms&#39;, verdana, arial, sans-serif;font-size:-webkit-xxx-large;&quot;&gt;&lt;a href=&quot;http://www.automatedqa.com/video/ddt-webinar-falafel/data-driven-testing-with-testcomplete7.wmv&quot; style=&quot;font-weight: normal; color:#3D81EE; text-decoration: underline; font-weight: bold; font-size: 15px; &quot;&gt;Data Driven Testing Video Tutorial&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:&#39;trebuchet ms&#39;, verdana, arial, sans-serif;color:#3D81EE;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: nowrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#333333;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/9044326203647197074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-data-driven-test.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/9044326203647197074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/9044326203647197074'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-data-driven-test.html' title='Testcomplete : Data Driven Testing Framework'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-5222783351616735508</id><published>2009-11-05T05:24:00.000-08:00</published><updated>2009-11-16T00:54:56.920-08:00</updated><title type='text'>TestComplete : To access column of Infragistics Grid using its index</title><content type='html'>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre; font-family:Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;To access column of Infragistics Grid using its index:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:Arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;function get_column(grid, columnindex)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;set get_column = grid.DisplayLayout.Bands.Item(0).Columns.Item(columnindex)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;end Function&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;---------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;You can use this function as bellow to get the header caption of a particular column&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;sub main&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt; MsgBox( get_column(DIGridControl,4).Header.get_Caption.ToString)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;end sub&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/5222783351616735508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-access-column-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/5222783351616735508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/5222783351616735508'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-access-column-of.html' title='TestComplete : To access column of Infragistics Grid using its index'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-1431655384885706719</id><published>2009-11-05T04:57:00.001-08:00</published><updated>2009-11-16T00:55:08.372-08:00</updated><title type='text'>TestComplete : To access cell of Infragistics UltraGrid using row index and column index</title><content type='html'>To access Infragistics grid&#39;s cell on the basis of row and column index:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;function get_cell(grid, row, column)&lt;/div&gt;&lt;div&gt;set get_cell = grid.DisplayLayout.Rows.Item(row).Cells.Item(column)&lt;/div&gt;&lt;div&gt;end Function&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can use this function as follow to set the value in it:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;sub main&lt;/div&gt;&lt;div&gt;&#39;here Ultragrid is the object of grid&lt;/div&gt;&lt;div&gt;call get_cell(Ultragrid, 0, 4).set_Value(&quot;checking&quot;)&lt;/div&gt;&lt;/div&gt;&lt;div&gt;end sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/1431655384885706719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-access-cell-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/1431655384885706719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/1431655384885706719'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-access-cell-of.html' title='TestComplete : To access cell of Infragistics UltraGrid using row index and column index'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-6508682681933191305</id><published>2009-11-04T01:38:00.000-08:00</published><updated>2009-11-16T00:55:24.593-08:00</updated><title type='text'>TestComplete : To make a perticular tab selected (Infratistics Ultratabcontrol)</title><content type='html'>&lt;div&gt;In infragistics Ultratabcontrol clicktab() method do not work correctly to make a tab selected or active. It gets recorded but at the time of play, the testcomplete does not click on the tab. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this case you can use the following procedure to select a tab.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;--------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;tabcontrol is the name of ultratabcontrol object&lt;/div&gt;&lt;div&gt;&#39;tabname is the name of tab (string)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;sub tab_click(tabcontrol, tabname)&lt;/div&gt;&lt;div&gt;     dim I&lt;/div&gt;&lt;div&gt;for I = 0 to tabControl.Tabs.Count-1&lt;/div&gt;&lt;div&gt;if tabControl.VisibleTabs.get_Item(I).Text.OleValue= cstr(tabname) then&lt;/div&gt;&lt;div&gt;tabControl.VisibleTabs.get_Item(I).Selected = true&lt;/div&gt;&lt;div&gt;end If&lt;/div&gt;&lt;div&gt;     Next&lt;/div&gt;&lt;div&gt;     end Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;------------------------------------------&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/6508682681933191305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-make-perticular-tab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/6508682681933191305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/6508682681933191305'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-make-perticular-tab.html' title='TestComplete : To make a perticular tab selected (Infratistics Ultratabcontrol)'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-2834189010005219979</id><published>2009-11-02T02:51:00.000-08:00</published><updated>2009-11-16T00:55:34.377-08:00</updated><title type='text'>Testcomplete : To get cell value from excel (.xls) file</title><content type='html'>&lt;div&gt;&#39;To get the cell value from .xls file workbook you can use the following function directly by passing the following parameters:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;file is the path of the excel file (string)&lt;/div&gt;&lt;div&gt;&#39;sheet is the name of sheet (workbook)  (string)&lt;/div&gt;&lt;div&gt;&#39;row and colum are the index of cell&#39;s row and column for which you need to get the value (int)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;---------&lt;/div&gt;&lt;div&gt;Function GetExcelData(file,sheet,row,colum)&lt;/div&gt;&lt;div&gt;Dim xlApp, xlFile, xlSheet,val&lt;/div&gt;&lt;div&gt;dim iRowCount,iColCount,cLoop&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Set xlApp = CreateObject (&quot;Excel.Application&quot;) &#39;Create access object&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Set xlFile = xlApp.Workbooks.Open(file) &lt;/div&gt;&lt;div&gt;&#39;Open the excel file,like&quot;C:\myTestData.xls&quot;&lt;/div&gt;&lt;div&gt;Set xlSheet = xlFile.Sheets(sheet) &#39;Set the sheet name in which the testdata locates&lt;/div&gt;&lt;div&gt;iRowCount = row&lt;/div&gt;&lt;div&gt;iColCount = colum&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For rLoop = 1 To iRowCount &#39;Fetch value from the first row to the last row&lt;/div&gt;&lt;div&gt;&#39;For cLoop = 1 To iColCount &#39; If you want to get the value cell-to-cell, you can add this line code&lt;/div&gt;&lt;div&gt;&#39;numAdd = numAdd&amp;amp;&quot; &quot;&amp;amp;xlSheet.Cells(rLoop,cLoop)&lt;/div&gt;&lt;div&gt;GetExcelData = xlSheet.Cells(rLoop,colum)&lt;/div&gt;&lt;div&gt;&#39;Next&lt;/div&gt;&lt;div&gt;Next &lt;/div&gt;&lt;div&gt;xlFile.Close&lt;/div&gt;&lt;div&gt;xlApp.Quit&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Set xlSheet = Nothing&lt;/div&gt;&lt;div&gt;Set xlFile = Nothing&lt;/div&gt;&lt;div&gt;Set xlApp = Nothing&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;end function&lt;/div&gt;&lt;div&gt;---------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also use this function to get all the values in a row for all the columns in excel file or vice versa by passing rows or column accordingly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;eg: to get all the values in all the rows for column(index=2), call the function in this way:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;row_count is the row count of the .xls file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;sub main&lt;/div&gt;&lt;div&gt;for row = 1 to row_count&lt;/div&gt;&lt;div&gt;msgbox(cstr(GetExcelData(path,sheet, row,2)))&lt;/div&gt;&lt;div&gt;end sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;                               OR&lt;/div&gt;&lt;div&gt;&#39;To get all the values in all the columns in row (index = 2) , all the function in this way:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&#39;col_count is the row count of the .xls file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;sub main&lt;/div&gt;&lt;div&gt;for col = 1 to col_count&lt;/div&gt;&lt;div&gt;msgbox(cstr(GetExcelData(path,sheet, 2,col)))&lt;/div&gt;&lt;div&gt;end sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/2834189010005219979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-cell-value-from.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/2834189010005219979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/2834189010005219979'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-cell-value-from.html' title='Testcomplete : To get cell value from excel (.xls) file'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-3939142087433431734</id><published>2009-11-02T02:46:00.000-08:00</published><updated>2009-11-16T00:55:46.238-08:00</updated><title type='text'>TestComplete : to get row count of excel sheet using DDT.exceldriver</title><content type='html'>&lt;div&gt;&#39;To get row count of excel sheet&lt;/div&gt;&lt;div&gt;&#39;path = path of .xls file (c:/test.xls)&lt;/div&gt;&lt;div&gt;&#39;sheet is the name of workbook sheet &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;function get_row_count(path,sheet)&lt;/div&gt;&lt;div&gt;dim inputdata&lt;/div&gt;&lt;div&gt;dim rowc&lt;/div&gt;&lt;div&gt;set inputData =  DDT.ExcelDriver(path, Sheet)&lt;/div&gt;&lt;div&gt;   while not inputdata.EOF&lt;/div&gt;&lt;div&gt;   inputdata.Next&lt;/div&gt;&lt;div&gt;   rowc = rowc+1&lt;/div&gt;&lt;div&gt;   Wend&lt;/div&gt;&lt;div&gt;get_row_count = rowc  &lt;/div&gt;&lt;div&gt;end Function&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/3939142087433431734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-row-count-of-excel.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/3939142087433431734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/3939142087433431734'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-row-count-of-excel.html' title='TestComplete : to get row count of excel sheet using DDT.exceldriver'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-5711357662484544667</id><published>2009-11-02T02:21:00.000-08:00</published><updated>2009-11-16T00:55:58.085-08:00</updated><title type='text'>TestComplete : To generate random number between two numbers</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;To get random number &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;Randomize is used as a seed to Rnd so that it will generate a random number each time.&lt;/div&gt;&lt;div&gt;&#39; A simple formula is used to generate a random number between two number: Int((max-min+1)*Rnd+min)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Function makeRandom(min, max)&lt;/div&gt;&lt;div&gt;Randomize&lt;/div&gt;&lt;div&gt;makeRandom = Int((max-min+1)*Rnd+min)&lt;/div&gt;&lt;div&gt;End function&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/5711357662484544667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-generate-random-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/5711357662484544667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/5711357662484544667'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-generate-random-number.html' title='TestComplete : To generate random number between two numbers'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-8425509454568062938</id><published>2009-11-02T02:08:00.000-08:00</published><updated>2009-11-16T00:56:11.514-08:00</updated><title type='text'>Testcomplete : To check if the value exists in Grid cell</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;To check if the value exists in the grid cell&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39; p_value is the value which you need to check&lt;/div&gt;&lt;div&gt;&#39; grid is the grid in which you need to check &lt;/div&gt;&lt;div&gt;&#39; colid is the ID (string) or index (int) of the column in which you need to check&lt;/div&gt;&lt;div&gt;&#39; you can get the function GetCellValue () in my previous post &quot;TestComplete: To get cell value using Row number and Column ID&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;This function will return 1 if it founds p_value in any of the cell in grid colid column or else will return 0 if does not found the p_value&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; function value(p_value, grid, colid)&lt;/div&gt;&lt;div&gt;              value = &quot;0&quot;&lt;/div&gt;&lt;div&gt;  for row = 0 to grid.rows.count -1&lt;/div&gt;&lt;div&gt;       if GetCellValue(grid,row,colid) = CStr(p_value)      then&lt;/div&gt;&lt;div&gt;       value = &quot;1&quot;     &lt;/div&gt;&lt;div&gt;       end If&lt;/div&gt;&lt;div&gt;        Next&lt;/div&gt;&lt;div&gt; End Function&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/8425509454568062938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-check-if-value-exists.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/8425509454568062938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/8425509454568062938'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-check-if-value-exists.html' title='Testcomplete : To check if the value exists in Grid cell'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-5551115469318638679</id><published>2009-11-02T01:50:00.000-08:00</published><updated>2009-11-16T00:56:20.888-08:00</updated><title type='text'>TestComplete : To get cell value using Row number and Column ID</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&#39;To get the cell Value based on Grid, row number and column ID&lt;/div&gt;&lt;div&gt;&#39;working in Infragistics grid as well&lt;/div&gt;&lt;div&gt;&#39; Grid is grid object in which you need value for rowIndex row and ColumnId column&lt;grid&gt;&lt;/grid&gt;&lt;/div&gt;&lt;div&gt;&#39; You can pass either ID (string) or Index (int) of the column for ColumnId parameter&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Function GetCellValue (Grid, RowIndex, ColumnId) &lt;/div&gt;&lt;div&gt; GetCellValue = Grid.wValue(rowindex,columnID)&lt;/div&gt;&lt;div&gt;end Function&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/5551115469318638679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-cell-value-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/5551115469318638679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/5551115469318638679'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/testcomplete-to-get-cell-value-using.html' title='TestComplete : To get cell value using Row number and Column ID'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-527288555548534823.post-3341502238098114765</id><published>2009-11-02T00:26:00.000-08:00</published><updated>2009-11-16T00:54:04.751-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Software Gyan"/><title type='text'>TestComplete : Connect to SQL database and fetch data by executing query</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;  &#39; Sample Code to Connect to database in Test Complete  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium; white-space: pre-wrap;&quot;&gt;  &#39; Database connection using Testcomplete&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Sub main&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Set AConnection = ADO.CreateADOConnection    &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;AConnection.ConnectionString = &quot;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=DG18\SQLEXPRESS&quot;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;AConnection.LoginPrompt = False   &#39; Suppress the login dialog box &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;AConnection.Open    &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Set RecSet = AConnection.Execute_(&quot;SELECT * FROM holding&quot;)   &#39; Execute a simple query &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;RecSet.MoveFirst &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;While Not RecSet.EOF &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Log.Message RecSet.Fields(&quot;Script&quot;).Value  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;RecSet.MoveNext&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Wend  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;AConnection.Close&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;  white-space: pre-wrap; font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;End sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:monospace;font-size:100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; white-space: pre-wrap;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://testwaregyan.blogspot.com/feeds/3341502238098114765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/powered-by-dharamveer-saxena.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/3341502238098114765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/527288555548534823/posts/default/3341502238098114765'/><link rel='alternate' type='text/html' href='http://testwaregyan.blogspot.com/2009/11/powered-by-dharamveer-saxena.html' title='TestComplete : Connect to SQL database and fetch data by executing query'/><author><name>Dharamveer Saxena</name><uri>http://www.blogger.com/profile/06816767768443438256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_6o58C7okKE17lGvshlifTxgZRTxV6AfLTKPSGzIgfo62hC7xRknEB_m_8PxFksefFV-F6HrFv-EYHaycNdf9FlmB_4oGePvus8At-rJOP6ompgQkY0gDpfFrq7IITQ/s220/Untitled.png'/></author><thr:total>6</thr:total></entry></feed>