<?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: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-8229406422458916242</id><updated>2011-07-07T19:01:52.511-07:00</updated><category term='BPT Testing'/><title type='text'>SoftwareTesting</title><subtitle type='html'>This blog will be helpful who are looking some real things for Automation Software Testing or Software Testing Technique.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-2655016523568818752</id><published>2011-05-12T05:03:00.000-07:00</published><updated>2011-05-13T13:47:07.623-07:00</updated><title type='text'>BPT testing process on SAP ECC application</title><content type='html'>&lt;div&gt;Automation of a SAP ECC application is quite easy then any other application if you have the correct add-in installed in your machine and server. Because here we could create a BPT component for each T-code and the make a test scenario to add different component in our test case.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Below is some screen shot for the process through QC:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/-W9RZyF8VDec/TcvNB92iELI/AAAAAAAAADU/b4IPdmgP9ms/s1600/Business+Component.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5605799594859565234" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 221px" alt="" src="http://3.bp.blogspot.com/-W9RZyF8VDec/TcvNB92iELI/AAAAAAAAADU/b4IPdmgP9ms/s320/Business%2BComponent.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Below is the screen for how to create test scenario with Business Components:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/-N_mi8QVwYJU/TcvNu_fV0OI/AAAAAAAAADc/R28I2gvLc0c/s1600/Test+Scenario.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5605800368393277666" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 218px" alt="" src="http://2.bp.blogspot.com/-N_mi8QVwYJU/TcvNu_fV0OI/AAAAAAAAADc/R28I2gvLc0c/s320/Test%2BScenario.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Below is screen how to run the test scenario from test lab:&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/-rBLWZWhNvN0/TcvOajl0pOI/AAAAAAAAADk/XLC4JJud5aI/s1600/Test+Lab+two.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5605801116818515170" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 219px" alt="" src="http://4.bp.blogspot.com/-rBLWZWhNvN0/TcvOajl0pOI/AAAAAAAAADk/XLC4JJud5aI/s320/Test%2BLab%2Btwo.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-2655016523568818752?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/2655016523568818752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2011/05/bpt-testing-process-on-sap-ecc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2655016523568818752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2655016523568818752'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2011/05/bpt-testing-process-on-sap-ecc.html' title='BPT testing process on SAP ECC application'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-W9RZyF8VDec/TcvNB92iELI/AAAAAAAAADU/b4IPdmgP9ms/s72-c/Business%2BComponent.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-4856554938491720748</id><published>2011-05-12T03:57:00.000-07:00</published><updated>2011-05-13T13:47:07.545-07:00</updated><title type='text'>Adding new Parameter in existing component for BPT process</title><content type='html'>In BPT process, never ever add any parameter with default data for any existing components. Because this might cause very bad effect on your other scenario what you are using presently. If you really want to add some parameter in your existing component then after adding the parameter delete the parameter value and save the component (i.e. save the component with new parameter with blank value). Always verify this should not cause any problem to the other scenario of your other test suite.&lt;br /&gt;&lt;br /&gt;By mistake if you add the parameter with default value and save then delete the parameter field from your component and save. And again add the parameter with blank value and save.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-4856554938491720748?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/4856554938491720748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2011/05/adding-new-parameter-in-existing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/4856554938491720748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/4856554938491720748'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2011/05/adding-new-parameter-in-existing.html' title='Adding new Parameter in existing component for BPT process'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-2075602639897419149</id><published>2010-02-12T03:46:00.000-08:00</published><updated>2010-05-09T21:17:01.455-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BPT Testing'/><title type='text'>BPT testing for SAP Applications</title><content type='html'>&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;BPT&lt;/span&gt; testing for SAP modules: I think this is one of the most complex test environments with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;BPT&lt;/span&gt; and SAP application. Well, every thing make us easy if we had a proper planning and system environment in order to start a new project for automation.&lt;br /&gt;Check list (In Order) for set up the automation test environment:&lt;br /&gt;1. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;QTP&lt;/span&gt; installation&lt;br /&gt;2. QC Installation&lt;br /&gt;3. SAP GUI installation &amp;amp; SAP environment configuration&lt;br /&gt;4. SAP Add In&lt;br /&gt;5. QC – &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;QTP&lt;/span&gt; connectivity set up.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, you are done with the system configuration.&lt;br /&gt;As we know that, SAP application will be quite complex environment to automate if the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;automator&lt;/span&gt; is not aware about the subject of SAP functionality. Basically, SAP is transaction depended &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;ERP&lt;/span&gt; module. It has lots of sub fields (like Material Management, Sales etc.) and transactions.&lt;br /&gt;Talk about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;BPT&lt;/span&gt;: Business Process Testing is the way to test the application against the business module created in Quality Center. Here we also have the option to create Business module through &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;QTP&lt;/span&gt; tool. The other option is to create through QC and then create the script in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;QTP&lt;/span&gt; and save in QC data base.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-2075602639897419149?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/2075602639897419149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2010/02/bpt-testing-for-sap-applications.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2075602639897419149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2075602639897419149'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2010/02/bpt-testing-for-sap-applications.html' title='BPT testing for SAP Applications'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-2518493477399286794</id><published>2009-08-25T11:49:00.000-07:00</published><updated>2009-08-25T12:29:57.916-07:00</updated><title type='text'>Limitations of QTP</title><content type='html'>&lt;strong&gt;&lt;span style="color:#009900;"&gt;Limitations to display on QTP Print log window:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;We are familiar with Print command in VB Script that is use to display the output lines in Print Log window. This is very similar to printf in C++ and System.out.print commands in Java.&lt;br /&gt;&lt;br /&gt;Syntax: Print “text”&lt;br /&gt;&lt;br /&gt;QTP Print log (Quick Test Print Log) window can write 1001 lines on it and 1024 characters in a line. So it has array of (1001 X 1024). If you enter more lines the previous lines will be deleted and most recent lines will be displayed. So it can handle 1001*1024= 1,025,024 characters to display at a time.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_U0CSqBZZ92Y/SpQzItleDaI/AAAAAAAAABM/WAHTezWsGMs/s1600-h/printlog.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5373976480128568738" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 339px" alt="" src="http://3.bp.blogspot.com/_U0CSqBZZ92Y/SpQzItleDaI/AAAAAAAAABM/WAHTezWsGMs/s400/printlog.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#009900;"&gt;Limitations to Display on QTP Message dialog window:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;We also very much familiar with Msgbox command in VB Script that is use to display output message in Message Dialog Window with ok button.&lt;br /&gt;&lt;br /&gt;Syntax: Msgbox “text”&lt;br /&gt;&lt;br /&gt;The maximum length of characters Prompt is exactly 1023 characters. But it might depend also on the width of the characters used. If Prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a line feed character (Chr(10)), or a carriage return/linefeed character combination (Chr(13) &amp; Chr(10)) between each line.&lt;br /&gt;&lt;br /&gt;This has been tested with the following code:&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;Dim Num&lt;br /&gt;Num=RanNumber(1023)&lt;br /&gt;print Num&lt;br /&gt;msgbox Num&lt;br /&gt;&lt;br /&gt;Function RanNumber(val)&lt;br /&gt; Dim d&lt;br /&gt; Set d=nothing&lt;br /&gt;    Set d = createobject("Scripting.Dictionary")&lt;br /&gt; For i =1 to val&lt;br /&gt;  r=RandomNumber (0,9)&lt;br /&gt;  d.add i, r&lt;br /&gt; Next&lt;br /&gt;  a = d.items   'Get the items.  &lt;br /&gt;  For i = 0 To d.Count -1 ' Iterate the array.&lt;br /&gt;     s = s&amp;a(i)'Create return string.  &lt;br /&gt;  Next&lt;br /&gt; RanNumber=s&lt;br /&gt;End Function&lt;br /&gt;&lt;/Div&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_U0CSqBZZ92Y/SpQ6WoNHX7I/AAAAAAAAABU/q6AAMkQm4ao/s1600-h/msgbox.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 102px;" src="http://4.bp.blogspot.com/_U0CSqBZZ92Y/SpQ6WoNHX7I/AAAAAAAAABU/q6AAMkQm4ao/s400/msgbox.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5373984415783804850" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-2518493477399286794?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/2518493477399286794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2009/08/limitations-of-qtp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2518493477399286794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2518493477399286794'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2009/08/limitations-of-qtp.html' title='Limitations of QTP'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_U0CSqBZZ92Y/SpQzItleDaI/AAAAAAAAABM/WAHTezWsGMs/s72-c/printlog.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-3838872665642338631</id><published>2009-08-18T14:29:00.000-07:00</published><updated>2009-08-18T14:52:28.614-07:00</updated><title type='text'>Mercury QuickTest Professional Shortcut Key Reference Card</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;&lt;span style="color:#009900;"&gt;Mercury QuickTest Professional Shortcut Key Reference Card&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;File Menu&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;New &gt; Test CTRL + N&lt;br /&gt;New &gt; Business Component CTRL + SHIFT + N&lt;br /&gt;New &gt; Scripted Component ALT + SHIFT + N&lt;br /&gt;New &gt; Application Area CTRL +Alt + N&lt;br /&gt;Open &gt; Test CTRL + O&lt;br /&gt;Open &gt; Business Component CTRL + SHIFT + O&lt;br /&gt;Open &gt; Application Area CTRL + ALT + O&lt;br /&gt;Save CTRL + S&lt;br /&gt;Export Test to Zip File CTRL + ALT + S&lt;br /&gt;Import Test from Zip File CTRL + ALT + I&lt;br /&gt;Print CTRL + P&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Edit Menu&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Cut CTRL + X (EV only)&lt;br /&gt;Copy CTRL + C&lt;br /&gt;Paste CTRL + V&lt;br /&gt;Delete DEL&lt;br /&gt;Undo CTRL + Z (EV only)&lt;br /&gt;Redo CTRL + Y (EV only)&lt;br /&gt;Rename Action F2&lt;br /&gt;Find CTRL + F (EV only)&lt;br /&gt;Replace CTRL + H (EV only)&lt;br /&gt;Go To CTRL + G (EV only)&lt;br /&gt;Bookmarks CTRL + B (EV only)&lt;br /&gt;Complete Word CTRL + Space (EV only)&lt;br /&gt;Argument Info CTRL + SHIFT + SPACE (EV only)&lt;br /&gt;Apply “With” To Script CTRL + W (EV only)&lt;br /&gt;Remove “With” Statements CTRL + SHIFT + W (EV only)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Insert Menu&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Checkpoint &gt; StandardCheckpoint F12&lt;br /&gt;Output Value &gt; Standard Output Value CTRL + F12&lt;br /&gt;Step &gt; Step Generator F7&lt;br /&gt;New Step F8 OR INS (KV only)&lt;br /&gt;New Step After Block SHIFT + F8 (KV only)&lt;br /&gt;Key: KV = Keyword View&lt;br /&gt;EV = Expert View&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Test/Component/Application Area Menu&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Record F3&lt;br /&gt;Run F5&lt;br /&gt;Stop F4&lt;br /&gt;Analog Recording CTRL + SHIFT + F4&lt;br /&gt;Low Level Recording CTRL + SHIFT + F3&lt;br /&gt;Step Menu&lt;br /&gt;Object Properties CTRL + ENTER&lt;br /&gt;Value Configuration Options CTRL + F11 on an input value&lt;br /&gt;(KV only)&lt;br /&gt;Output Options CTRL + F11 on an output value&lt;br /&gt;(KV only)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Debug Menu&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Pause PAUSE&lt;br /&gt;Step Into F11&lt;br /&gt;Step Over F10&lt;br /&gt;Step Out SHIFT + F11&lt;br /&gt;Insert/Remove Breakpoint F9&lt;br /&gt;Clear All Breakpoints CTRL + SHIFT + F9&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Data Table Options&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Edit &gt; Cut CTRL + X&lt;br /&gt;Edit &gt; Copy CTRL + C&lt;br /&gt;Edit &gt; Paste CTRL + V&lt;br /&gt;Edit &gt; Clear &gt; Contents CTRL + DEL&lt;br /&gt;Edit &gt; Insert CTRL + I&lt;br /&gt;Edit &gt; Delete CTRL + K&lt;br /&gt;Edit &gt; Fill Right CTRL + R&lt;br /&gt;Edit &gt; Fill Down CTRL + D&lt;br /&gt;Edit &gt; Find CTRL + F&lt;br /&gt;Edit &gt; Replace CTRL + H&lt;br /&gt;Data &gt; Recalc F9&lt;br /&gt;Insert Multi-line Value CTRL + F2 while editing cell&lt;br /&gt;Activate next/previous sheet CTRL + PAGEUP/CTRL + PAGEDOWN&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;General Options&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;View Keyword View/Expert View CTRL + TAB&lt;br /&gt;Open context menu for step or Data Table cell SHIFT + F10&lt;br /&gt;or Application key ( )&lt;br /&gt;Expand all branches * [on numeric keypad] (KV only)&lt;br /&gt;Expand branch + [on numeric keypad] (KV only)&lt;br /&gt;Collapse branch - [on numeric keypad] (KV only) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Here is a QTP References Card from Bas M. Dam&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_U0CSqBZZ92Y/SosiEnNQ2TI/AAAAAAAAABE/u9i3YM-s3Fs/s1600-h/references.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 285px; height: 400px;" src="http://4.bp.blogspot.com/_U0CSqBZZ92Y/SosiEnNQ2TI/AAAAAAAAABE/u9i3YM-s3Fs/s400/references.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5371424443208882482" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-3838872665642338631?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/3838872665642338631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2009/08/mercury-quicktest-professional-shortcut.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/3838872665642338631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/3838872665642338631'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2009/08/mercury-quicktest-professional-shortcut.html' title='Mercury QuickTest Professional Shortcut Key Reference Card'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_U0CSqBZZ92Y/SosiEnNQ2TI/AAAAAAAAABE/u9i3YM-s3Fs/s72-c/references.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-1076001210672048388</id><published>2009-07-24T14:48:00.000-07:00</published><updated>2009-07-24T15:15:09.816-07:00</updated><title type='text'>How to create a VBA Function Library for Use in VBScript/QTP</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color:#006600;"&gt;Creating a VBA Function Library for Use in VBScript/QTP:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;1. Open your MS Excel Sheet.&lt;br /&gt;&lt;br /&gt;2. Open a Module to write a VBA function. To open open Visual Basic Editor mudule folow this: Click ‘Tools =&gt; Macro =&gt; Visual Basic Editor &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;(This could be different for different version of MS Excel)&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_U0CSqBZZ92Y/SmowJxmFxdI/AAAAAAAAAA0/1aygN3_XBYA/s1600-h/mac.PNG"&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5362151250828051922" style="WIDTH: 501px; CURSOR: hand; HEIGHT: 193px" alt="" src="http://1.bp.blogspot.com/_U0CSqBZZ92Y/SmowJxmFxdI/AAAAAAAAAA0/1aygN3_XBYA/s400/mac.PNG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;3. Insert =&gt; Module &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_U0CSqBZZ92Y/Smot-tmYCNI/AAAAAAAAAAU/u87L9Wxc8r8/s1600-h/mac.PNG"&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5362148861753690322" style="WIDTH: 320px; CURSOR: hand; HEIGHT: 224px" alt="" src="http://3.bp.blogspot.com/_U0CSqBZZ92Y/Smot-tmYCNI/AAAAAAAAAAU/u87L9Wxc8r8/s320/mac.PNG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;4. Write your functions in the module&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_U0CSqBZZ92Y/SmovjeYxYTI/AAAAAAAAAAs/k2fLH9AZ2po/s1600-h/mac.PNG"&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5362150592836886834" style="WIDTH: 514px; CURSOR: hand; HEIGHT: 266px" alt="" src="http://3.bp.blogspot.com/_U0CSqBZZ92Y/SmovjeYxYTI/AAAAAAAAAAs/k2fLH9AZ2po/s400/mac.PNG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;5. Save your excel work book in a folder with suitable name(for example: C:\Joli.xls), you need to provide this path to your qtp script. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;6. Write the code in QTP to use your VBA functions&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;‘Create Excel application Object&lt;br /&gt;‘Use Run method of application to run the function&lt;br /&gt;‘Run (“’Path of excel file’!Modulename.Function Name”,”i/p Arguments”,”i/p arguments”) &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_U0CSqBZZ92Y/Smou2t_tzxI/AAAAAAAAAAk/8EKP4f-Wbe4/s1600-h/mac.PNG"&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5362149823932649234" style="WIDTH: 374px; CURSOR: hand; HEIGHT: 91px" alt="" src="http://4.bp.blogspot.com/_U0CSqBZZ92Y/Smou2t_tzxI/AAAAAAAAAAk/8EKP4f-Wbe4/s400/mac.PNG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-1076001210672048388?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/1076001210672048388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2009/07/how-to-create-vba-function-library-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/1076001210672048388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/1076001210672048388'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2009/07/how-to-create-vba-function-library-for.html' title='How to create a VBA Function Library for Use in VBScript/QTP'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_U0CSqBZZ92Y/SmowJxmFxdI/AAAAAAAAAA0/1aygN3_XBYA/s72-c/mac.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-8725622493783210070</id><published>2009-07-16T11:12:00.000-07:00</published><updated>2009-08-27T12:47:42.107-07:00</updated><title type='text'>Class Use in VB Scripts</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;Class Use in VB Scripts:&lt;br /&gt;Here is the basic example of creating a Class. Class ‘Student’ has been created to define the properties of a student. Then created a new instance (objStudent) to use this class definitation. This is a very basic example of Class. Following this class concept, you will be able to write any complex script using class.&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;Class Student&lt;br /&gt;   'In the declaration section of the Student class module&lt;br /&gt;Public StudentID&lt;br /&gt;Public FirstName&lt;br /&gt;Public LastName&lt;br /&gt;Public MajorCode&lt;br /&gt;Public YearLevel&lt;br /&gt;Public BirthDate&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;'Declare an object Student&lt;br /&gt;  Dim objStudent&lt;br /&gt;  &lt;br /&gt;  'Create an instance of the class&lt;br /&gt;  Set objStudent = New Student&lt;br /&gt;  On Error Resume Next&lt;br /&gt;&lt;br /&gt;  'Use the object Student&lt;br /&gt;  objStudent.StudentID = "12345"  '&amp;amp; CLng(2)&lt;br /&gt;  'Err.Raise 6&lt;br /&gt;  MsgBox ("Error # " &amp;amp; CStr(Err.Number) &amp;amp; " " &amp;amp; Err.Description)&lt;br /&gt;  Err.Clear     &lt;br /&gt;On Error GoTo 0&lt;br /&gt;  objStudent.FirstName = "Cathrina" '&amp;amp; CStr(lngCount)&lt;br /&gt;  objStudent.LastName = "Aniversario" '&amp;amp; CStr(lngCount)&lt;br /&gt;  objStudent.MajorCode = "C" '&amp;amp; CStr(lngCount)&lt;br /&gt;  objStudent.YearLevel = "Freshmen"' &amp;amp; CStr(lngCount)&lt;br /&gt;  objStudent.BirthDate = "Oct 10, 1980"' &amp;amp; CDate(lngCount)&lt;br /&gt; &lt;br /&gt;  MsgBox "Student ID : " &amp;amp; objStudent.StudentID &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;                                                "Student Name : " &amp;amp; objStudent.FirstName &amp;amp; " " &amp;amp; _&lt;br /&gt;                             objStudent.LastName &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;         "Major Code   : " &amp;amp; objStudent.MajorCode &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;         "Year         : " &amp;amp; objStudent.YearLevel &amp;amp; vbCrLf &amp;amp; _&lt;br /&gt;         "BirthDate    : " &amp;amp; objStudent.BirthDate&lt;br /&gt;        &lt;br /&gt;  Set objStudent = Nothing &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-8725622493783210070?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/8725622493783210070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2009/07/class-use-in-vb-scripts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/8725622493783210070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/8725622493783210070'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2009/07/class-use-in-vb-scripts.html' title='Class Use in VB Scripts'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-5492441372298968173</id><published>2009-07-15T14:25:00.000-07:00</published><updated>2009-09-03T10:23:19.371-07:00</updated><title type='text'>Good Sites to Hang around for QTP</title><content type='html'>&lt;p align="left"&gt;&lt;span style="font-family:times new roman;"&gt;Here are some good Sites to hang around for QTP learner:&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:times new roman;color:#009900;"&gt;&lt;u&gt;Personal WebPages/Blogs:&lt;/u&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family:times new roman;"&gt;&lt;a href="http://www.advancedqtp.com/"&gt;http://www.advancedqtp.com/&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt; - Solmar&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;a href="http://mercuryquicktestprofessional.blogspot.com/"&gt;http://mercuryquicktestprofessional.blogspot.com/&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt; - Ankur Jain&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;a href="http://www.learnqtp.com/"&gt;http://www.learnqtp.com/&lt;/a&gt; &lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;-Ankur Jain&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.intellipro.co.uk/automation.htm"&gt;&lt;span style="font-family:times new roman;"&gt;http://www.intellipro.co.uk/automation.htm&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; - Bill (Intellipro)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;a href="http://knowledgeinbox.com/"&gt;http://knowledgeinbox.com/&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt; - Tarun Lalwani&lt;br /&gt;&lt;/span&gt;&lt;a href="http://geekswithblogs.net/tmoore/Default.aspx"&gt;&lt;span style="font-family:times new roman;"&gt;http://geekswithblogs.net/tmoore/Default.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; - Theo Moore&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;a href="http://www.softwareinquisition.com/"&gt;http://www.softwareinquisition.com/&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt; -Will Roden&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.askqtp.blogspot.com/"&gt;&lt;span style="font-family:times new roman;"&gt;http://www.askqtp.blogspot.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; – Animesh&lt;br /&gt;&lt;/span&gt;&lt;a href="http://rajivkumarnandvani.wordpress.com/2009/04/"&gt;&lt;span style="font-family:times new roman;"&gt;http://rajivkumarnandvani.wordpress.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; – Ravi Kumar&lt;br /&gt;&lt;/span&gt;&lt;a href="http://quicktestprofessional.wordpress.com/category/excel-automation/"&gt;&lt;span style="font-family:times new roman;"&gt;http://quicktestprofessional.wordpress.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; - Mohan Kumar Kakarla&lt;/span&gt;&lt;br /&gt;&lt;a href="http://automated-chaos.blogspot.com/"&gt;&lt;span style="font-family:times new roman;"&gt;http://automated-chaos.blogspot.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; - Bas M. Dam (from Netherland) &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:times new roman;"&gt;----------------------------********************--------------------------------- &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#009900;"&gt;&lt;u&gt;Forums:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;a href="http://tdforums.tdadmins.com/index.php?act=idx"&gt;&lt;span style="font-family:times new roman;"&gt;http://tdforums.tdadmins.com/index.php?act=idx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.sqaforums.com/"&gt;&lt;span style="font-family:times new roman;"&gt;http://www.sqaforums.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;a href="http://www.advancedqtp.com/forums"&gt;http://www.advancedqtp.com/forums&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:times new roman;"&gt;----------------------------********************---------------------------------&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;&lt;span style="color:#009900;"&gt;&lt;u&gt;Some direct sites to access :&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://rajivkumarnandvani.wordpress.com/2009/04/"&gt;&lt;span style="font-family:times new roman;"&gt;http://rajivkumarnandvani.wordpress.com/2009/04/&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://quicktestprofessional.wordpress.com/category/excel-automation/"&gt;&lt;span style="font-family:times new roman;"&gt;http://quicktestprofessional.wordpress.com/category/excel-automation/&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.catenary.com/howto/compare.html"&gt;&lt;span style="font-family:times new roman;"&gt;http://www.catenary.com/howto/compare.html&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://qtpsecrets.com/Demos.html"&gt;&lt;span style="font-family:times new roman;"&gt;http://qtpsecrets.com/Demos.html&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/x0fxha2a(VS.85).aspx"&gt;&lt;span style="font-family:times new roman;"&gt;http://msdn.microsoft.com/en-us/library/x0fxha2a(VS.85).aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;a href="http://bughunterz.blogspot.com/"&gt;&lt;span style="font-family:times new roman;"&gt;http://bughunterz.blogspot.com&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.robvanderwoude.com/vbstech_objectbrowsers.php"&gt;&lt;span style="font-family:times new roman;"&gt;http://www.robvanderwoude.com/vbstech_objectbrowsers.php&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="left"&gt;&lt;b&gt;Donate User Functions:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://www.sqaforums.com/showflat.php?Number=347046"&gt;http://www.sqaforums.com/showflat.php?Number=347046&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;span style="font-family:times new roman;"&gt;----------------------------********************--------------------------------- &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#009900;"&gt;&lt;u&gt;VB Scripts Sources:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;a href="http://www.jsware.net/jsware/scripts.php5"&gt;&lt;span style="font-family:times new roman;"&gt;http://www.jsware.net&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://billsway.com/vbspage/"&gt;&lt;span style="font-family:times new roman;"&gt;http://billsway.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-5492441372298968173?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://debashis-paul.blogspot.com/feeds/5492441372298968173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://debashis-paul.blogspot.com/2009/07/good-sites-to-hang-around-for-qtp.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/5492441372298968173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/5492441372298968173'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2009/07/good-sites-to-hang-around-for-qtp.html' title='Good Sites to Hang around for QTP'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8229406422458916242.post-2396925084318491502</id><published>2009-07-15T13:56:00.000-07:00</published><updated>2009-09-21T10:53:36.673-07:00</updated><title type='text'>VB Script Objects</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;As we know, we frequently create the objects to perform some specific functions using defining the objects in our programming script. Specially when we use qtp, to write a descriptive programming, we need to create this objects.&lt;br /&gt;&lt;br /&gt;Here are some lists of objects that are frequently used in VB Script:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;Set objEmail = CreateObject( "CDO.Message" )&lt;br /&gt;Set objIE = CreateObject( "InternetExplorer.Application" )&lt;br /&gt;Set objInet = CreateObject( "InetCtls.Inet.1" )&lt;br /&gt;Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )&lt;br /&gt;Set objExcel = CreateObject( "Excel.Application" )&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;Set objExcelSheet = CreateObject( "Excel.Sheet" )&lt;br /&gt;Set objOutlook = CreateObject( "Outlook.Application" )&lt;br /&gt;Set objPpt = CreateObject( "PowerPoint.Application" )&lt;br /&gt;Set objWord = CreateObject( "Word.Application" )&lt;br /&gt;Set objCal = CreateObject( "MSCAL.Calendar" )&lt;br /&gt;Set objQPro = CreateObject( "QuattroPro.PerfectScript" )&lt;br /&gt;Set objWP = CreateObject( "WordPerfect.PerfectScript" )&lt;br /&gt;Set objConn = CreateObject( "ADODB.Connection" )&lt;br /&gt;Set objRecSet = CreateObject( "ADODB.Recordset" )&lt;br /&gt;Set objDic = CreateObject( "Scripting.Dictionary" )&lt;br /&gt;Set objFSO = CreateObject( "Scripting.FileSystemObject" )&lt;br /&gt;Set wshNetwork = CreateObject( "WScript.Network" )&lt;br /&gt;Set wshShell = CreateObject( "WScript.Shell" )&lt;br /&gt;Set objRandom = CreateObject( "System.Random" )&lt;br /&gt;Set objArrList = CreateObject( "System.Collections.ArrayList" )&lt;br /&gt;Set objSortList = CreateObject( "System.Collections.SortedList" )&lt;br /&gt;Set xmlDoc = CreateObject( "Microsoft.XmlDom" )&lt;br /&gt;Set xml2Doc = CreateObject( "Msxml2.DOMDocument.5.0" )&lt;br /&gt;Set objiTunes = CreateObject( "iTunes.Application" )&lt;br /&gt;Set objPlayer = CreateObject( "WMPlayer.OCX" )&lt;br /&gt;Set objWMPlayer = CreateObject( "WMPlayer.OCX.7" )&lt;br /&gt;Set objReal = CreateObject( "rmocx.RealPlayer G2 Control.1" )&lt;br /&gt;Set objFSDialog = CreateObject( "SAFRCFileDlg.FileSave" )&lt;br /&gt;Set objFODialog = CreateObject( "SAFRCFileDlg.FileOpen" )&lt;br /&gt;Set objDialog = CreateObject( "UserAccounts.CommonDialog" )&lt;br /&gt;Set SOAPClient = CreateObject( "MSSOAP.SOAPClient" )&lt;br /&gt;Set objWOL = CreateObject( "UltraWOL.ctlUltraWOL" )&lt;br /&gt;Set objSearcher = CreateObject( "Microsoft.Update.Searcher" )&lt;br /&gt;Set objShell = CreateObject( "Shell.Application" )&lt;br /&gt;Set objDeviceReplay=CreateObject("Mercury.DeviceReplay")&lt;br /&gt;&lt;br /&gt;Here are some examples how to use this objects:&lt;br /&gt;&lt;br /&gt;Description: Creates and returns a reference to an Automation object.&lt;br /&gt;&lt;br /&gt;Syntax: CreateObject(class)&lt;br /&gt;&lt;br /&gt;The class argument uses the syntax servername.typename and has these parts:&lt;br /&gt;servername: The name of the application providing the object.&lt;br /&gt;typename: The type or class of the object to create.&lt;br /&gt;&lt;br /&gt;Remarks: Automation servers provide at least one type of object. For example, a word-processing application may provide an application object, a document object, and a toolbar object. To create an Automation object, assign the object returned by CreateObject to an object variable:&lt;br /&gt;&lt;br /&gt;Dim ExcelSheet&lt;br /&gt;Set ExcelSheet = CreateObject("Excel.Sheet")&lt;br /&gt;&lt;br /&gt;This code starts the application creating the object (in this case, a Microsoft Excel spreadsheet). Once an object is created, you refer to it in code using the object variable you defined. In the following example, you access properties and methods of the new object using the object variable, ExcelSheet, and other Excel objects, including the Application object and the Cells collection. For example:&lt;br /&gt;&lt;br /&gt;' Make Excel visible through the Application object.&lt;br /&gt;ExcelSheet.Application.Visible = True&lt;br /&gt;&lt;br /&gt;' Place some text in the first cell of the sheet.&lt;br /&gt;ExcelSheet.Cells(1,1).Value = "This is column A, row 1"&lt;br /&gt;&lt;br /&gt;' Save the sheet.&lt;br /&gt;ExcelSheet.SaveAs "C:\DOCS\TEST.XLS"&lt;br /&gt;&lt;br /&gt;' Close Excel with the Quit method on the Application object.&lt;br /&gt;ExcelSheet.Application.Quit&lt;br /&gt;&lt;br /&gt;' Release the object variable.&lt;br /&gt;Set ExcelSheet = Nothing&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#ff0000;"&gt;Example 2: ("Excel.Application" )&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;For example to create an excel application object:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;‘Close all the open excel sheet open on your desktop&lt;br /&gt;Systemutil.CloseProcessByName "excel.exe"&lt;br /&gt;&lt;br /&gt;'Create a new excel file&lt;br /&gt;Set Excel = createObject("Excel.Application")&lt;br /&gt;&lt;br /&gt;‘Open the excel sheet&lt;br /&gt;Set SExcelSheet = Excel.Workbooks.Open("D:\Data\Compa.xls")&lt;br /&gt;&lt;br /&gt;‘Show the excel sheet in your desk to&lt;br /&gt;SExcelSheet.Application.visible=true&lt;br /&gt;&lt;br /&gt;‘Write the value (text) in the excel sheet(in 1st row, 2nd column)&lt;br /&gt;'Excel.ActiveSheet.cells(1,2).value="Text"&lt;br /&gt;'Excel.ActiveSheet.cells(1,1).value="Outertext_tag"&lt;br /&gt;&lt;br /&gt;'Close any pop up alart message box due to excel error&lt;br /&gt;Excel.DisplayAlerts = False&lt;br /&gt;'To run a macro in excel&lt;br /&gt;Excel.Run "Compa"&lt;br /&gt;‘Save the same updated file in different location with different name&lt;br /&gt;SExcelSheet.SaveAs "D:\Elements\BaseLine.xls"&lt;br /&gt;&lt;br /&gt;‘Close the excel sheet&lt;br /&gt;SExcelSheet.Close&lt;br /&gt;&lt;br /&gt;‘quit the excel application from system&lt;br /&gt;Excel.Quit&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-----------------&lt;br /&gt;&lt;span style="font-family:times new roman;color:#ff0000;"&gt;Example 3A: ("Scripting.FileSystemObject")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;'Drive path where you want to create the folder&lt;br /&gt;strDrive = “D:/Data”&lt;br /&gt;&lt;br /&gt;'Name of the folder to be created&lt;br /&gt;strfoldername= "New Folder"'&lt;br /&gt;&lt;br /&gt;‘Combined the path with folder name&lt;br /&gt;strPath= strDrive&amp;amp;strfoldername&lt;br /&gt;&lt;br /&gt;' Create FileSystemObject.&lt;br /&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;&lt;br /&gt;On Error Resume Next ' pass this error if folder already exist&lt;br /&gt;&lt;br /&gt;' Create a Folder, using strPath&lt;br /&gt;Set objFolder = objFSO.CreateFolder(strPath)&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-------------------&lt;br /&gt;&lt;span style="font-family:Times New Roman;color:#ff0000;"&gt;Example 3B:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;div class="code"&gt;' Get the name of file extentionmsgbox&lt;br /&gt;GetAnExtension("D:\Documents and Settings\Execution Summary.htm&lt;br /&gt;Function GetAnExtension(DriveSpec)&lt;br /&gt;Dim fso Set fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;GetAnExtension = fso.GetExtensionName(Drivespec) 'msgbox GetAnExtension&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-----------------------&lt;br /&gt;&lt;span style="font-family:times new roman;color:#ff0000;"&gt;Example 4: ("CDO.Message")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;Dim objMessage&lt;br /&gt;‘create the message object to send an email&lt;br /&gt;Set objMessage = CreateObject("CDO.Message")&lt;br /&gt;&lt;br /&gt;‘Add subject on your message&lt;br /&gt;objMessage.Subject = "QTP Results - Automated Testing"&lt;br /&gt;&lt;br /&gt;objMessage.From = "QTPTesting@address.com" ' Change this for your own from address&lt;br /&gt;&lt;br /&gt;objMessage.To = &lt;a href="mailto:your@email.com"&gt;your@email.com&lt;/a&gt; 'Send to email id&lt;br /&gt;objMessage.CC = &lt;a href="mailto:your@email.com"&gt;your@email.com&lt;/a&gt; 'CC to email id&lt;br /&gt;‘Body text message&lt;br /&gt;objMessage.TextBody ="N.B. - Please Do Not Reply This Message Directly.”&lt;br /&gt;&lt;br /&gt;'Include File attachments here&lt;br /&gt;objMessage.AddAttachment “D:\Data\file.text”&lt;br /&gt;&lt;br /&gt;'This section provides the configuration information for the remote SMTP server.&lt;br /&gt;objMessage.Configuration.Fields.Item _&lt;br /&gt;("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2&lt;br /&gt;&lt;br /&gt;'Name or IP of Remote SMTP Server&lt;br /&gt;objMessage.Configuration.Fields.Item _&lt;br /&gt;("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "someserver.domain.com"&lt;br /&gt;&lt;br /&gt;'Server port (typically 25)&lt;br /&gt;objMessage.Configuration.Fields.Item _&lt;br /&gt;("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25&lt;br /&gt;objMessage.Configuration.Fields.Update&lt;br /&gt;&lt;br /&gt;'End remote SMTP server configuration section==&lt;br /&gt;‘Send the email&lt;br /&gt;objMessage.Send&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-------------------&lt;br /&gt;&lt;span style="font-family:times new roman;color:#ff0000;"&gt;Example 5: ("Wscript.Shell")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;Set WshShell = CreateObject("Wscript.Shell")&lt;br /&gt;Dim Response&lt;br /&gt;' Displays a message box with the yes and no options.&lt;br /&gt;Response = MsgBox("Please Select your choice as 'Yes' or 'No'." &amp;amp; vbcrlf &amp;amp; vbcrlf &amp;amp; "Do you want to Select “Yes” or “No” ?", vbYesNo)&lt;br /&gt;' If statement to check if the yes button was selected.&lt;br /&gt;If Response = vbYes Then&lt;br /&gt;‘message box will appear for 3 second&lt;br /&gt;WshShell.Popup "You Have Been Selected “Yes”. Please wait.", 3, "Your Selection" ‘-WshSheel.Popup “message”, “time to wait”, “message box title”&lt;br /&gt;&lt;br /&gt;Else&lt;br /&gt;' The no button was selected.&lt;br /&gt;‘message box will appear for 5 second&lt;br /&gt;WshShell.Popup "You Have Been Selected “No”", 5, "Your Selection"&lt;br /&gt;End&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------&lt;br /&gt;&lt;span style="font-family:times new roman;color:#cc0000;"&gt;Example 6A: ("Mercury.DeviceReplay")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;strong&gt;Here is the example of 'Mercury.DeviceReplay' Object used in QTP:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;abs_x = objWebList.GetROProperty("abs_x")&lt;br /&gt;abs_y = objWebList.GetROProperty("abs_y")&lt;br /&gt;Set objMercuryMouse = CreateObject ("Mercury.DeviceReplay")&lt;br /&gt;mercuryMouse.MouseMove abs_x,abs_y&lt;br /&gt;Wait(3)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;Example 6B:("Mercury.DeviceReplay")&lt;/span&gt;&lt;br /&gt;We can use 'Mercury.DeviceReplay' simply to enter data in the fields. Here is a simple example of this. But before using this object, you need to select the object where the data needs to enter &lt;div class="code"&gt;&lt;br /&gt;obj.click&lt;br /&gt;For i = 1 to 10&lt;br /&gt;Set dr=CreateObject("Mercury.DeviceReplay")&lt;br /&gt;dr.SendString("hi")&lt;br /&gt;Set dr=Nothing&lt;br /&gt;Next&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;----------------------------&lt;br /&gt;&lt;span style="font-family:Times New Roman;color:#cc0000;"&gt;Example 7("Scripting.Dictionary")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;This function will generate user specified random numbers&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;RanNumber(2000)&lt;br /&gt;&lt;br /&gt;Function RanNumber(val)&lt;br /&gt;Dim d Set d=nothing&lt;br /&gt;Set d = createobject("Scripting.Dictionary")&lt;br /&gt;For i =1 to val&lt;br /&gt;r=RandomNumber (0,9)&lt;br /&gt;d.add i, r&lt;br /&gt;Next&lt;br /&gt;a = d.items 'Get the items.&lt;br /&gt;For i = 0 To d.Count -1 ' Iterate the array.&lt;br /&gt;s = s&amp;amp;a(i)'Create return string.&lt;br /&gt;Next&lt;br /&gt;RanNumber=s&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------------------&lt;br /&gt;&lt;span style="font-family:times new roman;color:#990000;"&gt;Example 8A: ("ADODB.Connection") /("ADODB.Recordset")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;br /&gt;&lt;strong&gt;This function will execute an specific query from database using a dedicated database connection string&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;Function database()&lt;br /&gt;v_DBInstance="RENPCRT8"&lt;br /&gt;v_MHXMLDBPwd="grudge"&lt;br /&gt;v_MHXMLDBSchema="Mhxmledit"&lt;br /&gt;&lt;br /&gt;'DATABASE connection&lt;br /&gt;Const adOpenStatic = 3&lt;br /&gt;Const adLockOptimistic = 3&lt;br /&gt;Const adUseClient = 3&lt;br /&gt;Set objConnection = CreateObject("ADODB.Connection")&lt;br /&gt;Set objRecordset = CreateObject("ADODB.Recordset")&lt;br /&gt;objConnection.Open "DRIVER={Microsoft ODBC for Oracle};UID="&amp;amp; v_MHXMLDBSchema &amp;amp;" ;PWD=" &amp;amp; v_MHXMLDBPwd &amp;amp; ";SERVER=" &amp;amp; v_DBInstance &amp;amp;";"&lt;br /&gt;objRecordset.CursorLocation = adUseClient&lt;br /&gt;objRecordset.CursorType = adopenstatic&lt;br /&gt;objRecordset.LockType = adlockoptimistic&lt;br /&gt;objRecordset.Source="select SOP from MHXML.FIRMS_STG where org_id in 681915"&lt;br /&gt;ObjRecordset.ActiveConnection=ObjConnection&lt;br /&gt;ObjRecordset.Open 'This will execute query&lt;br /&gt;If ObjRecordset.recordcount&gt;0 then&lt;br /&gt;Field1 = ObjRecordset("SOP").Value&lt;br /&gt;'Field2 = ObjRecordset("LAST_NAME").Value&lt;br /&gt;msgbox Field1&lt;br /&gt;'msgbox Field2&lt;br /&gt;End if&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;"&gt;---------------------------- &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="color:#990000;"&gt;Example 8B: ("Database connection without ADODB.Connection Object")&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:Times New Roman;"&gt;This function will retrive the database value even if the value is null or empty.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;Function GetAttorneyInfo(InField,ALid)&lt;br /&gt;&lt;br /&gt;v_DBInstance="RENPCRT8"&lt;br /&gt;v_MHXMLDBPwd="creek"&lt;br /&gt;v_MHXMLDBSchema="lbmgradmin"&lt;br /&gt;GetAttorneyInfo=""&lt;br /&gt;' Creating the database connection&lt;br /&gt;MHXMLconnection_string="DRIVER={Microsoft ODBC for Oracle};UID="&amp;amp; v_MHXMLDBSchema &amp;amp;" ;PWD=" &amp;amp; v_MHXMLDBPwd &amp;amp; ";SERVER=" &amp;amp; v_DBInstance &amp;amp;";"&lt;br /&gt;isMHXMLConnected = db_connect ( MHXMLConnection ,MHXMLconnection_string )&lt;br /&gt;If isMHXMLConnected=0Then ' get the data from the table&lt;br /&gt;v_Exe_SQL2="Select length(NVL(" &amp;amp; InField &amp;amp; ",'Data Not Found')) from lbmgradmin.ilv_vw where ilisting_id = " &amp;amp; ALid&lt;br /&gt;set RecSet_SOPInfo_LEN=db_execute_query( MHXMLConnection , v_Exe_SQL2 )&lt;br /&gt;d_SOPInfo_Length=db_get_field_value( RecSet_SOPInfo_LEN , 0 , 0 )&lt;br /&gt;'msgbox d_SOPInfo_Length&lt;br /&gt;v_Exe_SQL2="select substr(to_char(NVL(" &amp;amp; InField &amp;amp; ",'Data Not Found')),1," &amp;amp; d_SOPInfo_Length &amp;amp; ") from lbmgradmin.ilv_vw where ilisting_id = " &amp;amp; ALid&lt;br /&gt;set RecSet_SOPInfo=db_execute_query( MHXMLConnection , v_Exe_SQL2 )&lt;br /&gt;RowCnt=db_get_rows_count( RecSet_SOPInfo )&lt;br /&gt;If RowCnt=1Then&lt;br /&gt;d_SOPInfo=db_get_field_value( RecSet_SOPInfo , 0 , 0 )&lt;br /&gt;else&lt;br /&gt;datatable.SetCurrentRow(1)&lt;br /&gt;d_SOPInfo=db_get_field_value( RecSet_SOPInfo , 0 , 0 )&lt;br /&gt;End If&lt;br /&gt;else&lt;br /&gt;End If&lt;br /&gt;'If isMHXMLConnected=0 Then db_disconnect MHXMLConnection&lt;br /&gt;&lt;br /&gt;GetAttorneyInfo=d_SOPInfo&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;em&gt;' Database functions&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;Function db_connect( byRef curSession ,connection_string)&lt;br /&gt;dim connection&lt;br /&gt;on error Resume next&lt;br /&gt;' Opening connection&lt;br /&gt;set connection = CreateObject("ADODB.Connection")&lt;br /&gt;If Err.Number &lt;&gt; 0 then&lt;br /&gt;db_connect= "Error # " &amp;amp; CStr(Err.Number) &amp;amp; " " &amp;amp; Err.Description&lt;br /&gt;err.clear&lt;br /&gt;Exit Function&lt;br /&gt;End If&lt;br /&gt;connection.Open connection_string&lt;br /&gt;If Err.Number &lt;&gt; 0 then&lt;br /&gt;db_connect= "Error # " &amp;amp; CStr(Err.Number) &amp;amp; " " &amp;amp; Err.Description&lt;br /&gt;err.clear&lt;br /&gt;Exit Function&lt;br /&gt;End If&lt;br /&gt;set curSession=connection&lt;br /&gt;db_connect=0&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;em&gt;' Db Disconnect - Function to disconnect the database connection&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;Function db_disconnect( byRef curSession )&lt;br /&gt;curSession.close&lt;br /&gt;set curSession = Nothing&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;em&gt;' DB Execute Query - Function to execute the query&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;Function db_execute_query ( byRef curSession , SQL)&lt;br /&gt;set rs = curSession.Execute( SQL )&lt;br /&gt;set db_execute_query = rs&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;em&gt;' DB Function to get the number of rows in the record set&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;Function db_get_rows_count( byRef curRS )&lt;br /&gt;dim rows&lt;br /&gt;rows = 0&lt;br /&gt;curRS.MoveFirst&lt;br /&gt;Do Until curRS.EOF&lt;br /&gt;rows = rows+1&lt;br /&gt;curRS.MoveNext&lt;br /&gt;Loop&lt;br /&gt;db_get_rows_count = rows&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;em&gt;' Function to fetch the records from the record set&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;Function db_get_field_value( curRecordSet , rowIndex , colIndex )&lt;br /&gt;dim curRow&lt;br /&gt;curRecordSet.MoveFirst&lt;br /&gt;count_fields = curRecordSet.fields.count-1&lt;br /&gt;If ( TypeName(colIndex)&lt;&gt; "String" ) and ( count_fields &lt; db_get_field_value =" -1" db_get_field_value =" curRecordSet.fields(colIndex).Value"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;---------------------------- &lt;br&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;Example 8C: ("ADODB.Connection") /("ADODB.Recordset")&lt;/span&gt; &lt;br /&gt;&lt;div class="code"&gt;This following code will get the data from excel sheet located on the following path:&lt;br /&gt;Dim Get_Field&lt;br /&gt;set connectToDB = CreateObject("ADODB.Connection")&lt;br /&gt;connectToDB.Provider = "Microsoft.Jet.OLEDB.4.0"&lt;br /&gt;connectToDB.Properties("Extended Properties").Value = "Excel 8.0"&lt;br /&gt;connectToDB.Open "D:\Documents and Settings\pauldx\Desktop\Data.xls"&lt;br /&gt;strQuery="Select Age from [Data$] WHERE Name ='Joli'"&lt;br /&gt;Set rsRecord = CreateObject("ADODB.Recordset")&lt;br /&gt;rsRecord.Open strQuery,connectToDB,1,1&lt;br /&gt;' msgbox rsRecord.RecordCount&lt;br /&gt;If rsRecord.RecordCount&gt;0 Then&lt;br /&gt;for i= 1 to rsRecord.RecordCount&lt;br /&gt;Get_Field=rsRecord.Fields(0)&lt;br /&gt;print Get_Field&lt;br /&gt;rsRecord.movenext&lt;br /&gt;next&lt;br /&gt;Else&lt;br /&gt;Get_Field="Field Not Present"&lt;br /&gt;End If&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt;Example 9:("AcroExch.App" / "AcroExch.AVDoc")&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;strong&gt;&lt;br /&gt;‘Below code search for word ‘Software’ from the pdf file &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;div class="code"&gt;&lt;br /&gt;Option Explicit&lt;br /&gt;Dim accapp, acavdocu&lt;br /&gt;Dim pdf_path, bReset, Wrd_count&lt;br /&gt;pdf_path="C:\Program Files\Om\Om 1.1 User Manual.pdf"&lt;br /&gt;‘AcroExch is acrobat application object&lt;br /&gt;Set accapp=CreateObject("AcroExch.App")&lt;br /&gt;accapp.Show()&lt;br /&gt;&lt;br /&gt;‘Need to create one AVDoc object par displayed document&lt;br /&gt;Set acavdocu=CreateObject("AcroExch.AVDoc")&lt;br /&gt;&lt;br /&gt;'Opening the PDF&lt;br /&gt;If acavdocu.Open(pdf_path,"") Then&lt;br /&gt;acavdocu.BringToFront()&lt;br /&gt;bReset=1 : Wrd_count = 0&lt;br /&gt;'Find Text Finds the specified text, scrolls so that it is visible, and highlights it&lt;br /&gt;Do While acavdocu.FindText("software", 1, 1, bReset)&lt;br /&gt;bReset=0 : Wrd_count=Wrd_count+1&lt;br /&gt;Wait 0, 200&lt;br /&gt;Loop&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;accapp.CloseAllDocs()&lt;br /&gt;accapp.Exit()&lt;br /&gt;msgbox "The word 'software' was found " &amp;amp; Wrd_count &amp;amp; "times"&lt;br /&gt;Set accap=nothing : Set accapp=nothing&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;em&gt;(Note: you can only use the following code if you have acrobat professional installed. If you just have adobe reader standard version installed you will get this error message - "ActiveX component can't create object: 'AcroExch.PDDoc")&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------&lt;br /&gt;&lt;span style="color:#990000;"&gt;Example 10:("DotNetFactory")&lt;/span&gt;&lt;br /&gt;These Functions will conversion of Binary to Hexadecimal/ Decimal or vice versa.&lt;br /&gt;Here we can see the use of DotNetFactory utility with create an instance of “System.Convert”&lt;br /&gt;&lt;div class="code"&gt;&lt;br /&gt;‘Binary to Hexadecimal conversion&lt;br /&gt;Print "&amp;amp;H: " &amp;amp; BinToHex("00001110100111011111101000111011")&lt;br /&gt;&lt;br /&gt;Function BinToHex( bits )&lt;br /&gt;If( bits &lt;&gt; "" ) Then&lt;br /&gt;BinToHex = 2 * BinToHex( Left( bits, Len( bits ) - 1 ) ) + CLng( Right( bits, 1 ) )&lt;br /&gt;End If&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;‘Decimal to Binary conversion&lt;br /&gt;Print DecToBin(245234235,32)&lt;br /&gt;&lt;br /&gt;Public Function DecToBin( decNum, bitsCount )&lt;br /&gt;Dim str&lt;br /&gt;str = DotNetFactory.CreateInstance( "System.Convert" ).ToString( Clng( decNum ) , 2 )&lt;br /&gt;DecToBin = String( bitsCount - Len( str ), "0" ) &amp;amp; str&lt;br /&gt;End Function&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8229406422458916242-2396925084318491502?l=debashis-paul.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2396925084318491502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8229406422458916242/posts/default/2396925084318491502'/><link rel='alternate' type='text/html' href='http://debashis-paul.blogspot.com/2009/07/vb-script-objects.html' title='VB Script Objects'/><author><name>Debashis Paul</name><uri>http://www.blogger.com/profile/03827159191995770925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
