QTP Guide

QTP Step by Step Guide
An overview on Test Automation QTP Basic features Add-in Manager Key elements of QTP Test Pane QTP Commands QTP Test Process Recording Tests Keyword Driven Methodology Test Object Model Object Repository Object Identification Configuration QTP Test Methods

Data Table Methods
Descriptive Programming Enhancing Tests Inserting Checkpoints Inserting Output values

Parameterization Synchronization Inserting Transaction Points Step Generator Adding Comments Inserting Flow Control Statements Debugging Tests Running/Executing Tests Analyzing Test Results & Reporting Reporting Defects Actions Functions Environment Variables Regular Expressions Virtual Object Configuration Batching Testing Recovery Scenarios File System Operations Database connections Automation Object Model

Dynamic Handling of Object Repositories

An overview on Test Automation Test Automation
Basically Software Testing is 2 types 1) Manual Testing 2) Test Automation Manual Testing: Testing software manually is called Manual Testing. we can test all accepts of software manually. Below Testing Types can be tested manually Test Types: a) Functional Testing b) Regression Testing c) GUI Testing d) Usability Testing e) Security Testing f) Compatibility Testing g) Recovery Testing h) Reliability testing Etc… Drawbacks of Manual Testing (i)Time consuming. (ii) More resources required. (iii)Human Errors (iv)Repetition of the Task is not much (v)Tiredness (vi)Simultaneous auctions are not possible (Parallel) Test Automation: Testing Software using any Automation tools is called Test Automation Advantages of Test Automation:

4)It has some limitations (It cannot test every thing) Which Software Testing should be automated? Tests that need to be execute of every build of the application (Sanity Testing) Tests that use multiple data values (Retesting / Data Drives Testing) Tests that required data from application intimates (G.a) Fast: Tools are faster in execution than human users b) Reliable: Tools are reliable in complex calculations and tasks c) Reusable: we can reuse Automated Tests at any number of times d) Repeatable: we can repeat same operations for required number of times e) Programmable:we can use flow control statements for appalying logic f) Comprehensive: we can execute test batches without human interaction also Test Automation can be used in below areas of Testing: a) Functional & Regression Testing b) Load/Stress/Performance Testing c) Security Testing d) Unit Testing Drawbacks of Automation Testing 1)It is expensive 2)We cannot automate all areas. 3)Lack of expertisation.I.U. Attributes) Load and Stress Testing Which Software Testing should not be automated? Usability Testing One time testing .

methods. QTP Basic Features • • QTP Launched in 2002 (Nov). statements etc. Chinese.A. . functions. Later taken over by HP. word. we can automate test operations) (LoadRunner is a Protocol based Test Tool) • QTP is for Functional and Regression Testing. so HP developed LoadRunner for Windows as well as UNIX versions) • It supports GUI based (Graphical user interface) and Web based Applications Automation. By Mercury Interactive. (It supports English. (Basically QTP is a Functional and Regression Test tool but we can use it for little bit Compatibility Testing and Performance Testing) • It follows Keyword Driven Approach. example: Commands.S. Korean. Keywords.) • It has adapted Microsoft Visual Basic Scripting edition for programming and Excel like spread sheet for Data driven testing. Object models from QTP. so apart from scripting features we can use File system. (Keyword Driven Approach means. (Object based means. Excel. QTP Follows Test Object Model for Performing Testing operations.. QTP is an Object Based Testing Tool. Tools support for QTP: -----------------------------• VB Script for Scripting (for implementing programming logic) • VB Script engine integrated in QTP. Japanese. are used for creating Test scripts) • It supports Windows Operating Environment only. (QTP basically depends on User Interface to automate test operations and it is not depends on server side interactions. • It has multilingual support. in 2007. etc languages with respect to license. does not support CUI (Command user interface) Applications. where as LoadRunner depends on server side Operations.P (As soon as possible) Testing Ad-hoc testing / Random Testing Customers requirement are frequently changing. Based on either Test Objects or Automation Objects or Utility Objects only. Adodb etc.Quick look Tests or A.

we can use for any system but one user at any time. ------------------------------------------------------• QTP can be integrated with other Tools like WinRunner and Quality Center. Environment variables and for exporting object repositories. Version History of QuickTest Professional • Astra QuickTest (Mother tool of QTP) 1.6 – Nov 2002 • 6. • • QTP is a Desktop Application (I-Tier/Stand alone). • QTP uses XML format for Test results.5 – 2003 • 8. • QTP has UNI code support.2007 Mercury Interactive .9.0 – 2004 • 8.2. opera Etc apart from IE.0.0 to 5. • It was derived from Astra QuickTest (mother tool of QTP). 8.2.NET Technology. • • Seat or Node locked License.0 Quick Test Professional • 5. QTP developed in . If we want multiple concurrent licenses we can purchase.3 –2005 • 9.1-2006 • 9. • QTP can be used for user interface (UI) test case automation and some limited (Non UI) Test case automation like File system operations and Data base operations. • Seat license for one system and Concurrent License. so we can use SQL Statements in QTP to perform Database Operations • • Excel like spread sheet integrated in QTP for performing Data driven Testing We can install MS Script Debugger with QTP for Debugging Test scripts. Concurrent or float license. for execution it supports other browsers like Mozilla and AOL.• SQL (Structured query language) engine integrated in QTP. • It supports IE (Internet Explorer) only for recording tests. QTP has two types of License.

0..0) ...5.5 –2008 H.P • 10.00 –2009 January Overview ---------------------------------------------------------------a) Disadvantages of Manual Testing 1) Huge Amount of Human Resources as well as Environment (Test lab) 2) Time taking process 3) Less Accuracy 4) Tideness b) Advantages of Test Automation 1) 2) 3) 4) 5) 6) Fast Reliable Accurated Reusable Repeatable Comprehensive c) Draback of Test Automation 1) Expensive 2) Technical expertise 3) 100% Automation not Posible d) Types of Test Tool Business cla Technical cla -------------------------------------Vendor Tools Functional & Regression Test tools Opensource Performance/Load/stress Test tools In-House Test Management Tools Defect Management Tools Security Unit Test tools Etc.• 9.. -----------------------------------------------------------------------I) Basic Features of QTP ------------------------------------------------------------------------a) QTP Supporting Environments 1) UI (GUI/Windows and Web) 2) Only Windows (Clien side and Server side) b) Version History QTP derived from Astra QuickTest(1..

2) Integrated Tools (HP) Ex: Password Encoder.5. Test Result Dletion Tool etc.5 2003 8.. MS Script Debugger d) Key elements of QTP 1) Test Pane 2) Active Screen 3) Data Table 4) Debug Viewer 5) Information Pane 6) Missing Resources 7) QTP Commands --------------------------------------------------------------------------II) QTP Test Process --------------------------------------------------------------------------Manual Test Process (STLC) Vs QTP Test Process ----------------------------------------------------------------I) Planning I) Planning a) Analyzing Requirements a) Analyzing the AUT b) Test Strategy Implentation b) selecting/Creating Test case for Automation c) Test estimations c) Test Estimations & Approvals d) team formation d) Automation framework Implementation e) Risk Analysys e) QTP Tool Settings Configuration f) Configuration management g) Defining Test Environment h) Test Plan Documentation -------------------------------------------------------------------------------II) Test Design IIA) Creating the Basic Tests a) Repository based Test creation 1) Recording (Local Repository) 2) Keyword driven methodology (Shared a) Understanding & Analyzing Reqs b) Generating Test Scenarios c) Test case Documentation . 9.1 2006 9.5 2008--------HP 10. VB Script Engine. Checkpoints..0 2004 8. 3) Integrated Tools (Others) Ex: Spread sheet..2 2007 9.2 2005 9. Test Batch Runner.0 2009 (Jan) c) QTP License(Seat/Node Locked and Concurent/Float) c) QTP IDE 1) QTP Features Ex: Recording. Object Repository etc. SQL Engine.0.6 2002 (Nov) 6.

Repository) b) Descriptive Programming 1) Static Programming 2) Descriptive Programming IIB) Enhancing Tests a) Adding Comments b) Inserting Checkpoints c) Inserting Output values d) Inserting Transaction points e) Generating steps thru Step Generator f) Inserting Flow Control Statements g) Synchronization h) Parameterization i) Calling Functions / Actions j) Using Regular expressions k) Using Environment Variables l) Using Automation Objects (using Object Models) --------------------------------------------------------------------------------------------------------III) Test Execution ------------------IIIA) Debugging Tests (Optional) a) Forming Test Batches/suites a) Step by step execution b) Test Environment setup b) Watching Variables c) Test Execution c) Locating & Isolating Errors d) Analyzing Test Results d) Defect Reporting e) Defect Tracking III B) Running Tests f) Re & Regression Testing a) Single Test Run g) Test status Reporing b) Batch Testing h) Test Logs c) Executing Tests thru Framework i) Final Regression d) Scheduled execution e) Analyzing Results f) Result Reporing g) Defect Reporing h) Regression Testing ------------------------------------------------------------------------------------------IV) Test Closure IV) Test Closure ----------------a) evaluating Exit Criteria a) Sending Test scripts & Resources to Customer b) Collecting all facts from Test Activities b) Maintaning Tests & Resouce files c) sending Test Delivarables to Customer c) Improvement Suggessions d) Improvement Suggessions for QA Process --------------------------------------------------------------------------------------------III) Creating Tests / Test Scripts -----------------------------------------------------------------------------------------1) Repository based Test Design a) Recording (Local repository) .

b) Keyword Driven methodology (Shared repository) 2) Descriptive Programming a) Static Programming b) Dynamic programming Recording Tests ---------------a) Recording Process b) Recording Modes i) Normal Recording ii) Analog Recording iii) Low Level Recording c) Running Process Object Repository: -----------------a) Object and Types of Object i) Run-time Objects ii) Test Object Model iii) Utility Objects iv) Automation Objects b) Types of Object Repository i) Local Repository ii) Shared Repository c) Operations on Object Repository i) Adding Objects ii) Renaming Objects iii) Deleting Objects iv) Exporting Local Objects v) Merging Repositories vi) Associating Repositories to an Action vii) View Options viii) Exporting Objects to XML/Importing Objects from XML iX) Defining New Test Objects X) Spying Objects d) Object Identification Configuration i) Normal identification 1) Mandatory properties 2) Assistive properties ii) Smart Identification (Optional) .

generating tests c) Handling Dynamic Objects using Regular expressions d) Handling Duplicate/Similar Objects using Index property ---------------------------------------------------------------------------------- . generating Tests b) Dynamic Programming i) Creating Collection Objects ii) Entering Properties Information into Collection Objects iii) Using Collection Objects.1) Base Filter properties 2) Optional Filter properties iii) Ordinal Identifier 1) Location 2) Index 3) Creation Time (Only for web Application) Keyword driven methodoly: ------------------------a) Creating Shared Object Repositories b) Associating Repositories to an Action c) Creating tests manually i) Thru Expert View ii) Keyword View iii) generate steps thru Step Generator Descriptive programming: -----------------------a) Static programming i) identifying Unique Properties for Objects ii) Creating Constants iii)Creating Library file for constants iv) associating Library files / loading Library files during run-time v) Using Constants.

QTP Add ins Info

This document provides QuickTest Professional add ins information like Activex, web, visual basic, SAP, Java, .NET, People soft, TE, Web services and Oracle environments. I) ActiveX Environment Object Description ---------------------------------------------------ActiveX An ActiveX control. ---------------------------------------------AcxButton An ActiveX button. ------------------------------------------------AcxCalendar An ActiveX calendar object. ---------------------------------------------------AcxCheckBox An ActiveX check box. ---------------------------------------------------AcxComboBox An ActiveX combo box object. -------------------------------------------------------AcxEdit An ActiveX edit box. -----------------------------------------------------AcxRadioButton An ActiveX radio button. ----------------------------------------------AcxTable An ActiveX table. -----------------------------------------------AcxUtil An object that enables you to work with objects returned by performing an operation (usually via the Object property) on an ActiveX test object. ******************************************************** II) Delphi Environment Object Description ----------------------------------------DelphiButton A Delphi button. -------------------------------------------------DelphiCheckBox A Delphi check box. ---------------------------------------------------DelphiComboBox A Delphi combo box. ----------------------------------------------------DelphiEdit A Delphi edit box. ----------------------------------------------------DelphiEditor A Delphi multi-line editor.

------------------------------------------------------------DelphiList A Delphi list. -----------------------------------------------------------DelphiListView A Delphi list-view control. ------------------------------------------------------------DelphiNavigator A Delphi navigator control. -------------------------------------------------------------DelphiObject A Delphi object. -------------------------------------------------------------DelphiRadioButton A Delphi radio button. --------------------------------------------------------------DelphiScrollBar A Delphi scroll bar. -----------------------------------------------------DelphiSpin A Delphi spin box. ----------------------------------------------------DelphiStatic A Delphi static control. ----------------------------------------------------------DelphiStatusBar A Delphi status bar. ------------------------------------------------------------DelphiTable A Delphi table. -----------------------------------------------------------DelphiTabStrip A Delphi tab strip. ----------------------------------------------------------DelphiTreeView A Delphi tree-view control. -----------------------------------------------------------DelphiWindow A Delphi window or dialog box. *************************************************** III) Java Environment Object Description JavaApplet Java applet. -----------------------------------JavaButtonA Java button. ----------------------------------------JavaCalendar A Java calendar. ----------------------------------------JavaCheckBox A Java check box. ----------------------------------------JavaDialog A Java dialog box. -------------------------------------------JavaEdit A Java edit box. ------------------------------------------JavaExpandBar A Java control that contains labeled bar items, which can be expanded or collapsed by the user. -------------------------------------------------------JavaInternalFrame An internal frame that can be activated from the Java applet. ---------------------------------------------------------JavaLink A Java control that displays text with links. ----------------------------------------------------------------JavaList A Java list box with single or multiple selection. --------------------------------------------------------------------

JavaMenu A Java menu item. ----------------------------------------------------JavaObject A generic Java object. --------------------------------------------JavaRadioButton A Java radio button. -------------------------------------------JavaSlider A Java slider. ------------------------------------------JavaSpin A Java spin object. ------------------------------------------JavaStaticText A Java static text object. -----------------------------------------------------JavaTab A Java tabstrip control containing tabbed panels. ---------------------------------------------------------------JavaTable A Java table. --------------------------------JavaToolbar A Java toolbar. ----------------------------------JavaTree A Java tree. ----------------------------JavaWindow A Java window. --------------------------------------****************************************** IV) .NET Web Forms Environment Object Description -------------------------------------WbfCalendar A .NET Web Forms calendar control. ---------------------------------------------------------------WbfGrid A .NET Web Forms DataGrid object. ---------------------------------------------------------------WbfTabStrip A .NET Web Forms tabstrip control. -------------------------------------------------------------WbfToolbar A .NET Web Forms toolbar control. ------------------------------------------------------------WbfTreeView A .NET Web Forms tree view object. ------------------------------------------------------------WbfUltraGrid A .NET Web Forms UltraGrid object. ************************************************** V) .NET Windows Forms Environment Object Description --------------------------------SwfButton A .NET Windows Forms button object. SwfCalendar A DateTimePicker or a Month Calendar .NET Windows Forms calendar object. SwfCheckBox A .NET Windows Forms check box. SwfComboBox A .NET Windows Forms combo box.

SwfPropertyGrid A property grid control based on the . SwfStatusBar A . SwfEditor A . SwfLabel A . SwfTable A grid control based on the . . WpfImage An image control in a Windows Presentation Foundation application. SwfSpin A .NET Windows Forms window.NET Windows Forms tab control.NET Windows Forms multi-line edit box.NET Windows Forms library. WpfComboBox A combo box control in a Windows Presentation Foundation application. rich text box. WpfGrid A grid control in a Windows Presentation Foundation application.NET Windows Forms scroll bar. WpfEdit A document. SwfTreeView A .NET Windows Forms toolbar. SwfRadioButton A . WpfCheckBox A check box control in a Windows Presentation Foundation application.NET Windows Forms spin object.NET Windows Forms ListView control. SwfScrollBar A .NET Windows Forms radio button.NET Windows Forms library. SwfListView A . SwfList A . SwfToolBar A . WpfLink A hyperlink control in a Windows Presentation Foundation application.NET Windows Forms TreeView control. SwfObject A standard .NET Windows Forms object.NET Windows Forms list.NET Windows Forms edit box. SwfTab A .SwfEdit A . VI) Windows Presentation Foundation Environment Object Description WpfButton A button control in a Windows Presentation Foundation application.NET Windows Forms status bar control.NET Windows Forms static text object. or text control in a Windows Presentation Foundation application. WpfList A list control in a Windows Presentation Foundation application. SwfWindow A .

WpfRadioButton A radio button control in a Windows Presentation Foundation application. OracleFormWindow An Oracle Form window. OracleLogon An Oracle Applications sign-on window. WpfTreeView A tree control in a Windows Presentation Foundation application. OracleRadioGroup An Oracle option (radio button) group. OracleCalendar An Oracle calendar. OracleList An Oracle poplist (combo box) or list. WpfProgressBar A progress bar control in a Windows Presentation Foundation application. WpfToolbar A toolbar control in a Windows Presentation Foundation application.WpfMenu A menu control in a Windows Presentation Foundation application. OracleButton An Oracle button. OracleStatusLine . OracleNavigator An Oracle Navigator window. VII) Oracle Environment Object Description OracleApplications An Oracle Applications session window. WpfStatusBar A status bar control in a Windows Presentation Foundation application. WpfTabStrip A tab control in a Windows Presentation Foundation application. WpfObject An object control in a Windows Presentation Foundation application. OracleNotification An Oracle error or message window. WpfWindow A window control in a Windows Presentation Foundation application. OracleFlexWindow An Oracle flexfield window. OracleListOfValues An Oracle window containing a list of values for selection. WpfScrollBar A scroll bar control in a Windows Presentation Foundation application. OracleCheckbox A check box Oracle field. WpfSlider A slider control in a Windows Presentation Foundation application.

PbComboBox A PowerBuilder combo box. regular buttons. PbRadioButton A PowerBuilder radio button. PbCheckBox A PowerBuilder check box. PbObject A standard PowerBuilder object. IX) PowerBuilder Environment Object Description PbButton A PowerBuilder button. PbList A PowerBuilder list. PbEdit A PowerBuilder edit box. toolbar buttons. OracleTree An Oracle tree. OracleTable An Oracle block of records. buttons with text. PbDataWindow A PowerBuilder DataWindow control. VIII) PeopleSoft Environment Object Description PSFrame A frame object within a PeopleSoft application. OracleTextField An Oracle text field. PbListView A PowerBuilder listview control. PbScrollBar A PowerBuilder scroll bar. and buttons with text and image. X) SAP Web Environment Object Description SAPButton An SAP Gui for HTML application button. including icons. PbWindow A PowerBuilder window. PbTabStrip A PowerBuilder tab strip control PbTreeView A PowerBuilder tree-view control.The status line and message line at the bottom of an Oracle Applications window. SAPCalendar . OracleTabbedRegion An Oracle tabbed region.

including single-line edit boxes and multi-line edit boxes (text area). SAPGuiButton A button in an SAP GUI for Windows application. SAPTreeView An SAP Gui for HTML application tree object. SAPCheckBox An SAP Gui for HTML application toggle button. SAPGuiEdit An edit box in an SAP GUI for Windows application. SAPGuiGrid A grid control in an SAP GUI for Windows application. SAPRadioGroup An SAP Gui for HTML application radio button group.A calendar in a Web-based SAP application. SAPGuiComboBox A combo box in an SAP GUI for Windows application. SAPOKCode An OK Code box in an SAP Gui for HTML application. including check boxes and toggle images. SAPTable An SAP Gui for HTML application table or grid. SAPGuiCalendar A calendar object in an SAP GUI for Windows application. SAPNavigationBar A navigation bar in a Web-based SAP application. SAPGuiCheckBox A check box in an SAP GUI for Windows application. XI) SAP GUI for Windows Environment Object Description SAPGuiAPOGrid An APO grid control in an SAP GUI for Windows application. SAPGuiElement Any object in an SAP GUI for Windows application. SAPiView An SAP Enterprise Portal application iView frame. SAPList A drop-down or single/multiple selection list in an SAP Gui for HTML application. SAPDropDownMenu A menu that is opened by clicking a menu icon within an SAP Gui for HTML application. SAPFrame An SAP Gui for HTML application frame. SAPMenu An SAP Gui for HTML application top-level menu. SAPTabStrip An SAP Gui for HTML application tab strip object (an object that enables switching between multiple tabs). SAPStatusBar An SAP Gui for HTML application status bar. SAPEdit An SAP Gui for HTML application edit box. . SAPPortal An SAP Enterprise Portal desktop.

. SblEdit An edit box. SblCheckBox A check box with an ON and OFF state. SblTabStrip A number of tabs and four arrows that move its visible range to the left and to the right. SiebApplet An applet in a Siebel test automation environment. list tree. SiebButton A button control in a Siebel test automation environment. SblTable A Siebel table containing a variable number of rows and columns. SAPGuiTable A table control in an SAP GUI for Windows application. SAPGuiUtil A utility object in an SAP GUI for Windows application. SAPGuiSession Represents the SAP GUI for Windows session on which an operation is performed. or simple tree control in an SAP GUI for Windows application. SAPGuiToolbar A toolbar in an SAP GUI for Windows application. SAPGuiRadioButton A radio button in an SAP GUI for Windows application. SAPGuiMenubar A menu bar in an SAP GUI for Windows application. SAPGuiStatusBar A status bar in an SAP GUI for Windows application. SAPGuiTabStrip A tab strip in an SAP GUI for Windows application. SblTreeView A tree view of specific screen data. XII) Siebel Environment Object Description SblAdvancedEdit An edit box whose value can be set by a dynamic object that opens after clicking on a button inside the edit box SblButton A Siebel button. SAPGuiTextArea A text area in an SAP GUI for Windows application. SAPGuiOKCode An OK Code box in an SAP GUI for Windows application. SAPGuiWindow A window or dialog box containing objects in an SAP GUI for Windows application. SiebApplication An application in a Siebel test automation environment. SAPGuiTree A column tree. SblPickList A drop-down pick list.SAPGuiLabel A static text label in an SAP GUI for Windows application.

SiebRichText A rich text control in a Siebel test automation environment. SiebTaskUIPane The task UI pane in a Siebel test automation environment. SiebCurrency A currency calculator in a Siebel test automation environment. SiebCheckbox A checkbox in a Siebel test automation environment. SiebCalendar A calendar control in a Siebel test automation environment. SiebPageTabs A page tab in a Siebel test automation environment. Static . SiebTextArea A text area in a Siebel test automation environment. SiebText A text box in a Siebel test automation environment. SiebMenu A menu or menu item in a Siebel test automation environment. SiebCommunicationsToolbar The communications toolbar in a Siebel test automation environment. Dialog A Windows dialog box. SiebViewApplets A view applet in a Siebel test automation environment. SiebPDQ A predefined query in a Siebel test automation environment. SiebTaskAssistant The Task Assistant in a Siebel test automation environment. SiebList A list object in a Siebel test automation environment. SiebPicklist A pick list in a Siebel test automation environment. SiebView A view object in a Siebel test automation environment. SiebThreadbar A threadbar in a Siebel test automation environment. XIII) Standard Windows Environment Object Description Desktop An object that enables you to access top-level items on your desktop.SiebCalculator A calculator control in a Siebel test automation environment. SiebScreen A screen object in a Siebel test automation environment. SiebToolbar A toolbar in a Siebel test automation environment. SiebScreenViews A screen view in a Siebel test automation environment. SiebTree A tree view object in a Siebel test automation environment.

WinEdit A Windows edit box. WinComboBox A Windows combo box. WinEditor A Windows multi-line editor. WinTab A Windows tab strip in a dialog box. WinMenu A Windows menu. WinTreeView A Windows tree-view control. Window A standard window. WinObject A standard (Windows) object. WinStatusBar A Windows status bar. WinToolbar A Windows toolbar. WinList A Windows list. XIV) Stingray Environment Object Description WinTab A Windows tab strip in a dialog box. WinSpin A Windows spin box.A static text object. WinScrollBar A Windows scroll bar. WinButton A Windows button. WinTable A Stingray grid. WinRadioButton A Windows radio button. WinCheckBox A Windows check box. WinToolbar A Windows toolbar. SystemUtil An object used to control applications and processes during a run session. WinCalendar A Windows calendar. WinListView A Windows list-view control. . WinTreeView A Stingray tree control.

TeWindow A terminal emulator window. TeScreen A terminal emulator screen that fully supports HLLAPI. VbCheckBox A Visual Basic check box. VbTreeView A Visual Basic tree-view control. WinList A list in the VisualAge Smalltalk application. TeTextScreen A terminal emulator screen that uses text-only HLLAPI or does not support HLLAPI. VbRadioButton A Visual Basic radio button. VbLabel A static text object. XVII) VisualAge Smalltalk Environment Object Description WinButton A button in the VisualAge Smalltalk application. VbListView A Visual Basic list-view control. WinEdit An edit box in the VisualAge Smalltalk application. . VbEdit A Visual Basic edit box. XVI) Visual Basic Environment Object Description VbButton A Visual Basic button. VbScrollBar A Visual Basic scroll bar. VbToolbar A Visual Basic toolbar. VbWindow A Visual Basic window. VbFrame A Visual Basic frame. VbEditor A Visual Basic multi-line editor. VbList A Visual Basic list.XV) Terminal Emulators Environment Object Description TeField A terminal emulator field that fully supports HLLAPI. VbComboBox A Visual Basic combo box.

usually contained inside a form. WebList A drop-down box or multiple selection list. WebElement A general Web object that can represent any Web object. WebCheckBox A check box with an ON and OFF state. WinTab A tab strip in the VisualAge Smalltalk application. WebEdit An edit box. used to select a file from the File dialog box. ViewLink A Viewlink object.WinObject An object in the VisualAge Smalltalk application. Image An image with or without a target URL link. Frame An HTML frame. WinTreeView A tree-view control in the VisualAge Smalltalk application. WebTable A table containing a variable number of rows and columns. WebFile An edit box with a browse button attached. Link A hypertext link. WebXML An XML document contained in a Web page. Page An HTML page. WebButton An HTML button. WebArea A section of an image (usually a section of a client-side image map). XIX) Web Services Environment Object Description Attachments An object that supports attachment-related operations ----------------------------------------------------------------------------------------Configuration An object that supports configuration-related operations ----------------------------------------------------------------------------------------headers . WebRadioGroup A set of radio buttons belonging to the same group. WinTable A table in the VisualAge Smalltalk application. XVIII) Web Environment Object Description Browser A Web browser (or browser tab).

(It is a local concept) Action: It is a set of Statements. Test: It is a set of statements or set of one or more actions. Security An object that supports security-related test object operations. viewing and deleting test scripts. editing. method. QTP Tool Window Key Elements of QTP Tool Window 1) Test Pane: It is programming interface of QTP. statement etc).An object that supports header-related test object operations. Statements may have keywords. WebService A test object representing a Web service. (It is a local concept) Statement: A minimal executable unit. (Keyword such as function. WSUtil A utility object used to check WSDL files. used for creating. . It is a global concept.

Note1: Here in test pane Test is same but views are different. Expert view. Note 3: User can customize Test pane view options. It can be used for understanding and editing the test easily. it takes snap shots of every statement that user performed action or operation on AUT. Navigation: View menu>active screen (for launching and closing) . Navigation: Tools Menu> view options> we can use font size and colors etc.Test pane has 2 views. 2) Active Screen It has an optional element of QTP. Note 2: Technical users use expert view and business user use key word view.Test in Icon based GUI format. if you perform any modifications in one view those automatically reflects in another view. Key word view.Test in VB script format.

Note 1: Generally novice testers use this feature but it occupies lot of memory space on QTP. apply and okay. Navigation: View menu>Data table (for launching and closing) . used for Data driven testing. 3) Data Table It has an integrated spread sheet (Excel like).Configuring Active Screen: view>options>active screen tab>increase /Decrease capture level.

for entire Test /used for all actions in the Test. Importing data from external files (Flat files. excel sheets. Data table available in 2 ways: 1). Step over and Step out commands for debugging. 2).) It has two types of sheets. We use Step into. QTP has Data table methods for performing operations on data table.for specific Action only. Design time data table. 4) Debug Viewer It is used for locating and rectifying or fixing errors. Run time data table. Action Sheets. etc) and Data bases (MS access. oracle. (Attached with every test) 2). (Available in result window) Run time is a carbon copy of design time data table. (debug commands) Navigation: View menu>debug viewer (for launching and closing) .Data driven Testing: Testing the same task(S) or same operation with multiple sets of test data. 1). etc. 2. It can be used for debugging the tests by step-by-step execution. Enter test data directly into Data Table and use. Sql Server. It can be used in two ways. 1. Global Sheet.

Library files etc). Navigation: View menu >missing resources (for launching and closing) 6) Information This pane shows syntax errors automatically during saving the test. 5) Missing Resources It can be used for showing missing resources that attached to current test such as (Recovery Scenarios.Through Debug viewer user can watch variables and change values of variables temporarily. Navigation: view menu> information .

7) QTP Commands QTP Commands are available in 3 ways. open existing tests. Menu options 2). save tests. export tests in zip format. 1). . Short cut keys (for Some important operations only) QTP Tool Window Menus File menu: Through file menu user can create. Tool Bar options 3).

deleting and splitting actions. running and also we run tests. Debug viewer. modify and delete recovery scenarios.Edit Menu: It provides editing options and renaming. Through this menu we can create. call existing actions and copy existing actions. Debug Menu: This menu provides debug commands for step by step execution. Through this menu we can set tool options as well as test pane view options. view options and object identification configuration. In this menu step generator available. missing resources etc. . In this menu object spy option available. Through insert menu user can insert VB Script conditional and loop statements and transaction points (Start and End). analog recording and Low level recording. Window Menu: This menu provides QTP tool window style settings. Insert Menu: Through this menu user can inserting check points. Through insert menu user can create new actions. Help Menu: This menu provides QTP help as well as VB Script help. using this user can generate recordable and nonrecordable scripts. information. out put values. Automation Menu: This menu provides Record. (Properties and values) In this menu Virtual object option available. Data Table. Run options and Run setting options Through this menu we can start normal recording. synchronizing points. Through this menu we can stop recoding. Through this menu we can insert/remove/break points. Tools Menu: This menu provides Tools settings option. Through this menu we can create /modify/delete objects information and we can associate repositories. active screen. through this we can get object’s information. View menu: Through this menu we can launch and close. Resources Menu: This menu provides object repository and recovery scenarios options. through this option we can create virtual objects.

Through this menu we can contact technical support people and we can send feedback. Through this menu we can check for updates and download or install directly. .

Menu options 2. Opens an existing test.Tool Bar options 3. Command New > Test New > Business Component New > Scripted Component New > Application Area New > Function Library Open > Test Open > Business/Scripted Component Function Creates a new test. 1. Creates a new scripted component. export tests in zip format. open existing tests. save tests. . Creates a new business component.QTP Commands QTP Commands QTP Commands are available in 3 ways. Creates a new function library.Short cut keys (for Some important operations only) File menu: Through file menu user can create. Creates a new application area. Opens an existing business or scripted component.

Quality Center Version Provides a sub-menu of options for Control managing versions of QuickTest assets in Quality Center. Opens the relevant Save dialog box so you can save the open document. Opens the Quality Center Connection dialog box. Save Save As Saves the active document. Save Test with Resources Save All Enable Editing Export Test to Zip File Creates a zip file of the active document. Import Test from Zip File Imports a document from a zip file. The sub-menu is available only when you are connected to version-control enabled Quality Center project. . Saves all open documents. Opens an existing function library. Makes read-only function libraries editable. Saves a standalone copy of the current test together with its resource files. Closes the active function library. Closes all open function libraries. enabling you to connect to a Quality Center project.Open > Application Area Open > Function Library Close Close All Function Libraries Quality Center Connection Opens an existing application area.

Convert to Scripted Component Print Print Preview Converts a business component to a scripted component. (Available only from function libraries) Settings Process Guidance Management Associate Library '<Function Library Name>' with '<Document Name>' Recent Files Exit Lists the recently viewed files. Prints the active document. Displays the Keyword View as it will look when printed and enables you to modify the page setup. (Not relevant for function libraries) Opens the Process Guidance Management dialog box. enabling you to manage the list of processes that are available in QuickTest. Opens the Settings dialog box. deleting and splitting actions. Edit Menu: It provides editing options and renaming. . Command Undo Function Reverses the last command or deletes the last entry you typed. Associates the active function library with the open document. enabling you to define settings for the open document. Closes the QuickTest session.

Deletes the selection from your document. Copies the selection from your document. Separates an action into two sibling actions or into parent-child nested actions. Enables you to specify the number of run iterations according to the number of rows in the Data Table. Changes the name of an action.Redo Reverses the most recent operation of the Undo command. enabling you to paste it in an external application. Opens the Object Properties dialog box for a Action > Action Call Properties Step Properties > Comment Properties Step Properties > . Pastes the selection to your document. Cut Copy Paste Delete Copy Documentation to Clipboard Action > Split Action Action > Rename Action Action > Delete Action Enables you to remove the selected call to the action. and associated object repositories for a stored action. parameters. Copies the content of the Documentation column of the Keyword View. or delete the action and its calls from the active test. Available only when the selected step is a comment. Opens the Comment Properties dialog box for a comment step. and to define the values of input parameters and the storage location of output parameters. Action > Action Properties Enables you to specify options. Removes the selection from your document.

Displays the Report Properties dialog box for a report step. Available only when the selected step is an output value step. Step Properties > Report Properties Find Replace Go To Bookmarks Advanced > Comment Comments out the current row. Indents the step according to the tab spacing defined in the Editor Options dialog box. Step Properties > Opens the relevant Checkpoint Properties Checkpoint Properties dialog box for a selected object. Advanced > Outdent .Object Properties selected object.ReportEvent step. or selected Block rows. Step Properties > Output Value Properties Opens the relevant Output Value Properties dialog box for a selected object. Outdents the step (reduces the indentation) according to the tab spacing defined in the Editor Options dialog box. Searches and replaces a specified string. Available only when the selected step contains a test object. Available only when the selected step is a Reporter. Searches for a specified string. Available only when the selected step is a checkpoint step. Moves the cursor to a particular line in the test. Advanced > Uncomment Block Advanced > Indent Removes the comment formatting from the current or selected rows. Creates bookmarks in your script for easy navigation.

Advanced > Go to Function Definition

Navigates to the definition of the selected function.

Advanced > Complete Completes the word when you type the Word beginning of a VBScript method or object. Advanced > Argument Displays the syntax of a method. Info Advanced > Apply "With" to Script Generates With statements for the action displayed in the Expert View, and enables IntelliSense within With statements. Converts any With statements in the action displayed in the Expert View to regular (single-line) VBScript statements. Inserts an optional step (a step that is not required to successfully complete a run session).

Advanced > Remove "With" Statements

Optional Step

View menu: Through this menu we can launch and close, active screen, Data Table, Debug viewer, information, missing resources etc.

Insert Menu: Through this menu user can inserting check points, out put values, synchronizing points.

In this menu step generator available, using this user can generate recordable and nonrecordable scripts.

Through insert menu user can insert VB Script conditional and loop statements and transaction points (Start and End).

Through insert menu user can create new actions, call existing actions and copy existing actions.

Automation Menu: This menu provides Record, Run options and Run setting options Through this menu we can start normal recording, analog recording and Low level recording.

Through this menu we can stop recoding, running and also we run tests.

Command
Record Run

Function
Starts a recording session. Starts a run session from the beginning or from the line at which the session was paused. Stops the recording or run session. Runs only the active action.

Stop Run Current Action Run from Step

Starts a run session from the selected step.

Maintenance Run Starts a run session during which the Mode Maintenance Run Mode wizard opens for steps that failed because an object was not found in the application (if applicable). Update Run Mode Starts a run session to update test object descriptions and other options (if applicable). Analog Recording Starts recording in Analog Recording mode.

Low Level Recording Record and Run Settings

Starts recording in Low Level Recording mode. Opens the Record and Run Settings dialog box, enabling you to define browser preferences for recording and running your test.

Process Guidance Lists the processes that are available for List the current document type and for the currently loaded QuickTest add-ins, enabling you to open them. Results Enables you to view results for a test run session.

Resources Menu:

This menu provides object repository and recovery scenarios options. Through this menu we can create /modify/delete objects information and we can associate repositories. Through this menu we can create, modify and delete recovery scenarios.

Command
Object Repository

Function
Opens the Object Repository window, which displays a tree containing all objects in the current test or component. Opens the Object Repository Manager dialog box, enabling you to open and modify multiple shared object repositories. Opens the Associate Repositories dialog box, enabling you to manage the object repository associations for the test.

Object Repository Manager

Associate Repositories

enabling you to map repository parameters. In this menu object spy option available. enabling you to customize how tests and function libraries are displayed in the Expert View and Function Library windows. enabling you to open them. View Options Check Syntax . through this option we can create virtual objects. view options and object identification configuration. (Properties and values) In this menu Virtual object option available. Through this menu we can set tool options as well as test pane view options. Opens the Recovery Scenario Manager dialog box. enabling you to modify global testing options. Tools Menu: This menu provides Tools settings option. as needed. Checks the syntax of the active document. Recovery Scenario Manager Associated Function Libraries Debug Menu: This menu provides debug commands for step by step execution. Command Options Function Opens the Options dialog box. Through this menu we can insert/remove/break points. Lists the function libraries associated with the active document. Opens the Editor Options dialog box.Map Repository Parameters Opens the Map Repository Parameters dialog box. through this we can get object’s information.

Object Identification Opens the Object Identification dialog box. identification properties. enabling you to teach QuickTest to recognize an area of your application as a standard test object. enabling you to specify a recording configuration level. enabling you to specify how QuickTest identifies a particular test object. as well as the test object hierarchy. which displays the default Constants list for the action. and operations of the test object that QuickTest uses to represent that object. Object Spy Opens the Object Spy dialog box. (Relevant for tests only) Opens the Virtual Object Wizard. which enables you to customize toolbars and menus. Opens the Web Event Recording Configuration dialog box. Opens the Customize dialog box. . (Relevant for tests only) Replaces the previously recorded Active Screen with the selected Active Screen. and create new menus. Web Event Recording Configuration Data Driver Change Active Screen Virtual Objects > New Virtual Object Virtual Objects > Virtual Object Manager Customize Window Menu: This menu provides QTP tool window style settings. enabling you to view the native properties and operations of any object in an open application. (Relevant for tests only) Opens the Data Driver dialog box. Opens the Virtual object Manager. enabling you to manage all of the virtual object collections defined on your computer.

QTP Test Process 7 Stages of QTP Testing Process 1) Planning o o o o Analyzing the AUT Automation Test Plan Generation Automation Framework Implementation Generating/Selecting Test cases for Automation . Through this menu we can check for updates and download or install directly. Through this menu we can contact technical support people and we can send feedback.Help Menu: This menu provides QTP help as well as VB Script help.

o Collecting Test Data o QTP Tool Settings Configuration 2) Generating Tests o Recording o Keyword driven methodology o Descriptive Programming 3) Enhancing Tests o o o o o o o o o o Inserting Checkpoints Inserting Output values Adding Comments Synchronization Parameterization Inserting Flow Control Statements Calling User defined functions and/or Reusable Actions Generating Steps though Step Generator Inserting Transaction Points Regular Expressions 4) Debugging Tests o o o o Debug Commands & Break Points Step by step execution Watching Variables Changing values of variables 5) Running Tests o o o o o Normal Execution Batch Execution Through AOM Scripting Tests Running through framework Scheduled Execution 6) Analyzing Results o o o o QTP Result window Defining our own Results Exporting Results Deleting Results 7) Reporting Defects o Manual Defect Reporting o Tool based Defect Reporting o Working with Quality Center ----------------------------------------------------------Types of Statements in QTP Test / Test Script i) Declarations (Variables and constants) .

.exe" **It launche the Application Ex2: SystemUtil.Click iii) Comments iv) Flow Control Statements (Conditional & Loop) Ex:) If Total=Tickets*Price Then Msgbox "Test Passed" Else Msgbox "Test Failed" End If v) Function / Action calls Ex: Call Login("gcreddy".WinEdit("Agent Name:").Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.com/" vii) VB script other statements Examples: Option Explicit Wait (14) Recording Tests Recording and Running a) Test Recording Process It is a Process of Recording user operations on AUT (Application Under Test).Set "gcreddy" Ex2: Browser("Google").Page("Google").Run "C:\Program Files\Internet Explorer\IEXPLORE.Dim x.icicibank. and generates them in a script in the Expert view. During Recording QTP Creates steps in Keyword view."http://www. Simultaneously it adds Objects information into Object Repository.Link("Gmail")."mercury") vi) Utility Statements Ex1: SystemUtil. Price ii) Object calls Ex1: Dialog("Login"). z Const City. y.EXE".

Record and Run only on) If we select first option it records on any opened application on Desktop. Navigation: Automation>Record Or Select Record option on automation toolbar Or Use short cut key (F3) Steps for preparing a Test (through Recording): 1. c) Recording Modes QTP has 3 Recording Modes to generate Tests / Test Scripts i) Normal Recording It records User Mouse and Keyboard operations on AUT with respect to objects.Record and Run Test on any open window based applications 2. based on that Information performs operations on AUT. The Track file is not editable.Select Record Option 3. If we select Second option.Save the Test ii) Analog Recording: It records the exact mouse and keyboard operations.It shows Record and Run Settings.) 5.Click OK 6. Select type of Environment (Windows or Web) 4. After Providing the path it records only on that particular application. but unable to record continuous mouse operations like Digital Signatures.Select Record Option (It shows two Options : 1. generates total user actions in a Track File.Perform actions on AUT 7.Put AUT in base state 2. It is not useful for recording normal operations why because it does not generate steps for each operation. During recording QTP generates VbScript statements in Test Pane. graphs. 8. Simultaneously it stores objects information into object repository. it asks for the path of the AUT. We can use this mode for recording continuous mouse operations.b) Running /Execution Process During Running QTP reads statements one by one and gets Object Information from the Object Repository.Keep tool under recording mode . paints etc.Stop recording. Navigation: 1.

2. after showing the Window it records with respect to that window co-ordinates. This mode records at the object level and records all run time objects as window or winobject Test objects.Record relative to the screen 2. So Modifications are very difficult . 6.Analog Recording Settings Dialog box opens (In this Dialog box two options available.Select Record option 3.Select any one option in the dialog box and click Start Analog record.Launch AUT (or we can launch AUT through QTP) 2.It records User actions 7.Keep tool under recording mode 2.Stop Recording iii) Low Level Recording It records some operations on Non-supported environments apart from Normal operations.Automation >Low Level Recording Steps for preparing a Test (through Low Level Recording): 1)Launch AUT (or we can launch AUT through QTP) 2)Select Record option 3)Automation> Low Level Recording 4)Perform options on AUT 5)Stop Recording 6)Save the Test d) Disadvantages of Recording • It occupies a lot of memory space(due to duplicate objects). Navigation: 1.Automation>Analog Recording 4.) 5. Use Low Level Recording for recording in an environment not recognized by QTP. we have to show the window (AUT).Record relative to the following window) (If we select first option QTP records User operations with respect to Desktop co-ordinates. So QTP reduced performance will be • No Centralized Maintenance mechanism .Automation >Analog Recording OR Use Short cut Key (Shift + ALT+F3) Steps for preparing a Test (through Analog Recording): 1. If we select Second option. 1.

So locating errors is difficult • Recorded scripts are QTP internal files. it is possible to begin preparing our .• User may not have command on the Recorded script. our tests become more modular. they may corrupt. focusing on the operations to test using both QuickTest built-in keywords and your own user-defined keywords. e) Advantages of Recording/ Where Applicable • It is used for Analyzing the AUT in the initial stage to find out weather the QTP tool is Recognizing all of our Application Objects or not • It is easy to create Tests / Test Scripts •It is used for frequently changing UI (User Interface) • It takes less time to create Tests Keyword Driven Methodology Keyword-Driven Methodology By creating our tests with a keyword-driven methodology in mind. Additionally. because it is possible to add objects to the object repository before they exist in an application.

we need to configure QuickTest to use this infrastructure: Define your global testing preferences. We can create object repositories using QuickTest functionality to recognize and learn the objects in your application. Ensure that objects in the object repository have names that are easy for application testers to recognize and that follow any established object naming guidelines. We may perform the following tasks when creating tests and test steps: . Add (learn) objects from our application. We need to specify configuration settings that affect how we create and run tests in general—these settings are not test-specific.automated keyword-driven tests even before a software build containing the new objects is available. Setting up Object Repositories In this step. Building our Tests We can create tests that are as simple or complex as needed. We instruct QuickTest to learn the objects in our application according to filters that we define. it is best to create tests and actions that check just one or a few simple functions or complete a transaction rather than creating long tests and actions that perform several complex tasks or that perform many tasks. we build one or more object repositories and ensure that all objects have clear names that follow any predetermined naming conventions defined by our organization. By creating and populating shared object repositories that can be associated with multiple actions. we can use the same object repository in multiple tests. or we can manually define objects. This helps make both test creation and maintenance easier over time. In general. Configuring QuickTest According to our Testing Needs After we set up the test automation infrastructure.

Create new tests. Create the required actions. Associate our object repositories with the relevant actions This enables us to insert steps that perform operations on those objects. a sub-set of these properties that can uniquely identify objects of that class. . and a set of relevant operations that QuickTest can perform on the object. This enables us to use our special keywords in any of the associated tests Test Object Model Test Object Model The test object model is a large set of object types or classes that QuickTest uses to represent the objects in your application. select File > New > Test. To do so. Associate our function libraries with the relevant tests. if needed. Each test object class has a list of identification properties that QuickTest can learn about the object.

When QuickTest learns an object in our application. Native operations are the methods of the object in your application as defined by the object creator. see Viewing Object Properties and Operations Using the Object Spy. Netscape for Netscape Browser objects. You can modify identification properties manually while designing your test. For example. During a run session. or you can parameterize property values with Data Table parameters so that a different value is used during each iteration of the test. Similarly. The native property set for each run-time object is created and maintained by the object creator (for example. the Click method is applicable to a WebButton test object. Understanding and Using Regular Expressions. • Reads the current value of the object's properties in your application and stores the list of identification properties and values with the test object. You can also use regular expressions to identify property values based on conditions or patterns you define. For more information.A test object is an object that QuickTest creates in the test to represent the actual object in your application. generally using the value of one of its prominent properties. you specify which operation to perform on each test object. You may need to modify the identification property values to match the native property values. We can view the current identification property values of any object on your desktop using the Properties tab of the Object Spy. Property values of objects in your application may change dynamically each time your application opens. Test Object and Native Properties and Operations The identification property set for each test object is created and maintained by QuickTest. When you add an object to an object repository. • Chooses a unique name for the test object. and so on). the product developer for ActiveX objects. which is a storehouse for objects. QuickTest records the relevant operation as it is performed on an object. Microsoft for Microsoft Internet Explorer objects. QuickTest stores information on the object that will help it identify and check the object during the run session. or based on certain conditions. . QuickTest: • Identifies the QuickTest test object class that represents the learned object and creates the appropriate test object. we can add test objects to an object repository in several ways. For more information. As you add steps to your test. see Managing Test Objects in Object Repositories. a test object operation is a method or property that QuickTest recognizes as applicable to a particular test object class. or use SetTOProperty statements during a run session. see Specifying or Modifying Property Values. If you record steps. For more information on modifying object properties. QuickTest performs the specified test object operation on the run-time object. You can view or modify the identification property values that are stored with your test in the Object Properties or Object Repository dialog box. it adds the corresponding test object to an object repository. A run-time object is the actual object in your application on which methods are performed during the run session.

as described in Inserting Calls to Existing Actions). if required. If you are new to using QuickTest. For more information. so that only that action can access the stored objects. see Accessing Native Properties and Operations. By storing objects in shared object repositories and associating these repositories with your actions. For more information. Object information that applies to many actions is kept in one central location. you can access the internal operations and properties of the run-time object using the Object property. When the objects in your application change. see Deciding Whether to Use Local or Shared Object Repositories. see Viewing Object Properties and Operations Using the Object Spy. according to the order in which the shared object repositories are associated with the action. see Associating Object Repositories with Actions. A local object repository stores objects in a file that is associated with one specific action. or you can store the objects in your tests in one or more shared object repositories. If the available test object operations and identification properties for a test object do not provide the functionality you need. or modifying shared object repositories because all objects are automatically saved in a local object repository that can be accessed by its corresponding action. you can use the same shared object repository for multiple actions—if the actions include the same objects. choosing. In this way. In this way. Understanding Object Repository Types Objects can be stored in two types of object repositories—a shared object repository and a local object repository. For more information on associating shared object repositories. We can retrieve property values from the run-time object during the run session by adding GetROProperty statements. You can also use the attribute object property to identify Web objects in your application according to user-defined properties. the object definition is used from the first occurrence of the object. This reduces maintenance and enhances the reusability of your tests because it enables you to maintain the objects in a single. you can update them in one location for all the actions that use this shared object repository. see Retrieving and Setting Identification Property Values. For information. you enable multiple actions to use the objects. If you are familiar with testing. For each action. . you may want to use local object repositories. When you plan and create tests. You can also transfer local objects to a shared object repository. A shared object repository stores objects in a file that can be accessed by multiple tests (in read-only mode). For more information. If an object with the same name is located in both the local object repository and in a shared object repository associated with the same action. the action uses the local object definition. We can retrieve or modify property values of the test object during the run session by adding GetTOProperty and SetTOProperty statements in the Keyword View or Expert View. you can record and run tests without creating. you can use a combination of objects from your local and shared object repositories. shared location instead of multiple locations. You can store the objects for each action in its corresponding local object repository. If an object with the same name is located in more than one shared object repository associated with the same action. according to your needs.We can view the syntax of the test object operations as well as the native operations of any object on your desktop using the Operations tab of the Object Spy. your changes do not have any effect on any other action or any other test (except tests that call the action. you must consider how you want to store the objects in your tests. If you modify an object in the local object repository. it is probably most efficient to save objects in a shared object repository.

you can use the same object repository for multiple actions. and can be accessed only from that action. When you open and work with an existing test. it always uses the object repositories that are specified in the Associated Repositories tab of the Action Properties dialog box or in the Associate Repositories dialog box. you edit them using the Object Repository Manager. Object Repository Object Repository: It is a storage place of QTP where objects information can be stored and it also acts as interface between the Test script and the AUT in order to identify the objects during execution. You can also use multiple object repositories for each action. When using a shared object repository.Local objects are saved locally with the action. Shared object repositories are read-only when accessed from tests. Software objects: . which has structure and properties. Object: Object is something.

Ex: Creating objects in filesystemobject class. as software objects. Types of Object in QTP: There are four types of object available in QTP. 3.. Local repository (. . Utility objects They are QTP reserved objects used for Testing and Result reporting. Links. Shared repository(. Reporter for defining results. Excel. etc… Test Objects: References of Run time objects. delete operations on local repository. adodb. Run time objects: The objects present in the AUT. Ex: 1. dictionary object class. 4. 1.We call Windows. Services for inserting transaction points 4. User can add some more objects to Local repository User can perform rename. 1. As it is QTP internal file user no need to save modifications. WinButton.MTR extension) 2. those can be used for performing specific operations. Environment for using environment variables Automation objects/User defined objects User can create objects. Edit boxes. WebButton. SystemUtil for launching/closing the application. Run time objects Test objects Utility objects Automation objects/User defined objects.connection class. Buttons. Web Pages. 2. 2. Check boxes etc. Ex: WinEdit. 3. There are two types of repository available in QTP.TSR extension) Local Repository: QTP creates a Local Repository for every Action automatically during Recording. Ex: Buttons. That cannot be shared among tests. etc… Note: Test objects names vary from one environment to another. Link. Application class etc.

Shared Repository: Navigation: Resource menu>object repository manager>object>Add objects>show the window/object>click ok o o o o Selected object only Default object types All objects types Selected object types (If we select first option it stores Selected objects only. it saves automatically) B. Operations on Object Repository Adding objects a. if we select second option it stores all default objects. we have to select object classes then it stores that class objects.Shared Repository: User (Test Engineer) creates the Shared Repository by adding objects. Local Repository: . if we select fourth option. That can be shared among number of tests. if we select third option it stores All objects including static objects. Local Repository: Navigation: open Local Repository (Resource Menu > Object Repository) objects>Add objects to Local> Show the Object>Click Ok (No need to save separately. Using this method user can perform modifications on objects easily.) Renaming Objects a. we can select more than one class also.

Shared Repository: Resources >object repository manager>file>open>browse path of the repository file >file>enable editing>select object &Right click>choose delete option>confirm the deletion >save the file & close repository manager.Resources > object repository >select object and right click >choose rename option >modify the name>release the mouse. Associating Object Repositories to an Action/Test Resources>Associate repositories>click add icon (+)>browse path of the repository>Associate with an action>click ok Merging Repositories Resources > object repository manager>tools>object repository merge tool >browse path of the first repository> browse path of the second repository>click ok>click close>save the merged repository>close the repository manager. Navigation>Tools>object spy>take hand icon & Show the object>get information (Object Spy shows the specific objects all available properties with their values) . Local Repository: Resources > object repository >select object and right click >choose delete option >confirm deletion>. property & Values) QTP is providing a feature called Object Spy. Deleting Objects a. source repository files will be available. using this we can get objects information. Spying Objects For getting objects information. (Test objects names. >close repository b. Defining New Test Objects Navigation: Object>Define new test object >Select Environment>Select Class of the object>Enter name of the object>Click Add>click close>Select object >select property name>enter value (like this select one by one properties and enter values)>save Note: This feature can be used for preparing tests before the AUT is ready. Shared Repository: Resources >object repository manager>file>open>browse path of the repository file >file>enable editing>select object &Right click>choose rename option>modify the name > release mouse>save the file & close repository manager. Note: After merging also.>close repository b. if we do not want source files we can delete.

Navigation: Select object in the repository >view>highlight in application>it highlights specified objects in the application. We can import XML file to our repository. Navigation: File>import from XML >browse path of the XML file >it loads objects. Exporting Repository to an XML file We can export our repository file to an xml file. Importing Repository from XML file. In tools Menu 2.Note: As Object spy is an important feature. Navigation: File >export Test objects to XML Enter the file name and Save with xml extension. In Repository manager) View Options Locate in Repository This feature can be used for identifying objects from application to repository. Navigation: View>Locate in repository >show the object>click Ok>it locates specified object in the repository. Highlight in Application This feature can be used for identifying objects from repository to application. it can be available in 3 Areas.(1. Note: The purpose of this feature is Editing objects information outside of the QTP Navigation: Resource menu>object repository (Short cut key Ctrl+R) Object Identification Configuration Object Identification Configuration Overview: . In local repository 3.

QTP learns information in the following in case of Smart Identification: Smart identification is an optional feature. qtp recognizes object using 2 0r 3 important properties. and then we configure Smart Identification for that object. It learns first assistive property and once again stops and thinks. if we feel that config is not sufficient for recognizing objects in our application. if we feel normal identification is not sufficient for any object. like this qtp learns one by one. in order to avoid Ordinal Identifier. if it feels sufficient then it stops learning otherwise. Qtp has default object identification configuration for every environment. At the end of assistive properties list also if it feels not satisfied and it finally goes to Ordinal Identifier. we can configure some more Object Identification Types a) 1) 2) b) 1) 2) c) 1) 2) 3) Normal identification Mandatory properties Assistive properties Smart identification base filter properties optional filter properties Ordinal identifier location index creation time(only for web) QTP learns information in the following in case of normal identification: First of all the qtp learns all the mandatory properties at a time and thinks whether these properties sufficient to identify the object uniquely. After normal identification if qtp feels not satisfied then it goes to smart .Generally for every object 20-25 properties information available.

Tool Settings Globalization: As QTP is a I-tier(Stand-alone) application. in smart identification 2 types of properties available. first qtp learns all base filter properties at a time and thinks whether these properties are sufficient for identifying the object uniquely. STEPS: 1) Settings available in 3 areas. qtp generates 0. If it feels sufficient. Still it feels not satisfied finally it goes to Ordinal Identifier. Ordinal identifiers: There are 3 types of ordinal identifiers available 1) Location: is based on object location in the AUT . . QTP is providing a special feature called "Generate Script". NOTE: After executing these scripts all team members can get same settings.2 like numbers. then it stops learning otherwise it goes Optional Filter Properties and learns one by one.location starts from zero.identification. a) File->Settings b) Tools->Options c) Tools->Object Identification 2) Perform required settings and generate Scripts 3) Share Script files to team members and ask them to execute those scripts.1. 2) index: it is based on sequence of the programs. index starts from zero 3) Creation time: it is based on loading time of the web objects. For making tool settings global.making Tool settings globally is not possible.

QTP Methods .

Activate: It activates dialog boxes/Windows Syntax: Object hierarchy. Activate Ex: Dialog(“Login”).Activate Window(“Flight Reservation”).Activate Click Method: It clicks on an object (Buttons) Syntax: Object hierarchy. Click Ex: Dialog(“Login”).Winbutton(“ok”).click Close Method: It closes the window,Dialog box, Browser window etc. Syntax: Object hierarchy. Close Ex: Window(“Flight Reservation”).Close Browser(“Browser”).Close Dblclick: It Double clicks the object. Set Method: It can be used in three ways. a. For setting the value of an edit box Syntax: Object Hierarchy. SET “Value” Ex: Dialog (“Login”).WinEdit(“Agent Name”).Set “asdf” b. Selecting a Radio Button Syntax: Object Hierarchy. Set Ex: Window("Flight Reservation").WinRadioButton("Business").Set c. Selecting/Deselecting check boxes Syntax:object Hierarchy.Set “ON/off” Ex: Window ("Flight Reservation"). Dialog("Open Order").WinCheckBox("Order No.").Set "ON" Select Method: It is used for selecting an item from a combo box or list box. Syntax: Object hierarchy.select “item” Ex: Window("Flight Reservation").WinComboBox("Fly From:").Select "London" Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "12572 GetVisibletext: It returns Text from the specified area. Syntax: Variable =object hierarchy.getvisibletext Ex: x=Window("Flight Reservation").WinComboBox("Fly From:").GetVisibleText msgbox x GetRoproperty: It returns current object property value. It can be used for getting any object’s, any property value. Syntax: Variable = object hierarchy.getroproperty (“property name”) Ex: x=Window("Flight Reservation").WinEdit("Tickets:").GetROProperty ("width") msgbox x Navigate Method: It opens a specified URL in the Browser. Syntax: object hierarchy.navigate “URL” Ex: Browser("Yahoo!").Navigate http://www.google.co.in/

Getitemscount: It returns number of items in a combobox. Syntax: Variable=object hierarchy.getitemscount Ex: x=Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount msgbox x Getcontent: It returns all items from a combobox. Syntax: variable=object hierarchy.GetContent Ex: x=Window("Flight Reservation").WinComboBox("Fly From:").GetContent msgbox x Exist property: It checks whether the object is available or not. Syntax: Object hierarchy.exist(time in seconds) Ex: Window("Flight Reservation").Exist(5)

Data Table Methods

QTP Data Table Methods
(1) Add Sheet: We can use this method to “add” one new sheet to the run time data table. Syntax: DataTable.AddSheet "sheet name" Ex: DataTable.AddSheet "gcreddy" (2) Delete Sheet: We can use this method to “delete” one specified sheet from the Run Time Data table. Syntax: datatable.DeleteSheet (Sheet_ID) Ex: datatable.DeleteSheet (3) (3) GetSheetCount We can use this method to count number of sheets in the run time data table. Syntax: datatable.GetSheetCount msgbox datatable.GetSheetCount (4) GetRowCount We can use this method to count number of rows in the 1st sheet (longest column) of the Run time data table. Syntax: datatable.GetRowCount Ex: msgbox datatable.GetRowCount (5) GetSheet We can use this method to return a specified sheet from the Run Time data table. Syntax: datatable.GetSheet(SheetID) Ex: msgbox datatable. GetSheet(1).GetRowCount (6) Value

Value(Parameter_Name.Value (1.Value(Parameter_Name. Sheet_Name) = Value / variable To get data Syntax: Variable = datatable. Sheet_Name) Ex: Option explicit Dim a.SetNextRow Ex: g="gcreddy" datatable.Value (1.SetCurrentRow(Row_Number) g="gcreddy" datatable. To set data Syntax: datatable. Syntax: datatable.SetNextRow datatable.1) = g (8) SetNextRow We can use this method to take the row after the current Row as New Current Row in the Run time data table.1) b=datatable.Value (3. c a=datatable. Sheet_Name) = Value / variable Or datatable(Parameter_Name.SetCurrentRow (3) datatable. Sheet_Name) Or Variable = datatable(Parameter_Name.We can use this method to set or get value of cell in the specified parameter and the current row of the Rum time data table.1) = c Note: Default property of Datatable is value (7) SetCurrentRow We can use this method to take a specified row as current row in the Run Time Datatable (By default it is 1st Row of 1st Sheet) Syntax: datatable.Value (1.1) = g . b.1) c=cint(a)+cint(b) datatable.Value (2.SetCurrentRow (3) datatable.

Import “Path of File” Ex: datatable.ImportSheet “E:\gcreddy. Syntax: datatable.Export “Path of File” Ex: datatable.xls”.(9) SetPrevRow We can use this method to take the row before the current Row as New Current Row in the Run time data table.1 (12) Export We can use this method to export a copy of Run Time Data table to another location (Including all sheets) Syntax: datatable.Import “F:\Inputdata. “Destination Sheet” Ex: datatable.1) = s (10) Import We can use this method to import Microsoft Excel File to the Runtime Data Table (Including all sheets) Syntax: datatable.Value (1. “Source Sheet”.xls” 13) ExportSheet We can use this method to export a copy specified sheet of Run Time Data table to the . Syntax: datatable.3.Export “F:\gcreddy.ImportSheet “Path of File”.xls” 11) ImportSheet We can use this method to import a specified sheet of Microsoft Excel Sheet to the Runtime Data table.SetPrevRow Ex: g="gcreddy" datatable.SetCurrentRow (3) datatable.SetPrevRow datatable.

"res"."".GetRowCount For i= 1 to Rows_count Datatable.1.3)=Login Reporter."Passed" else Reporter.Click Dialog("Login").Click End If If Window("Flight Reservation").3) Dialog("Login").exist(10) Then Login="Login Operation Successful" Datatable("Result".xls".Activate Dialog("Login").GetSheet(3)."Failed" Login="Login Operation Failed" Datatable("Result"."res".Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a. 2 ********************** Data Driven Testing for Login Operation using Data Table methods Datatable.WinButton("OK").ExportSheet “F:\gcreddy.Dialog("Flight Reservations").3) Dialog("Login").Close End if Next .AddSheet "Login" Datatable.ImportSheet "C:\Documents and Settings\gcr\Desktop\gcreddy.3 Rows_count=Datatable.Click If window("Flight Reservation")."C:\Program Files\HP\QuickTest Professional\samples\flight\app\".WinEdit("Password:"). Syntax: datatable.Exist(3)Then Window("Flight Reservation").exe".WinButton("Cancel").SetCurrentRow(i) SystemUtil.existing or new Excel File.Set Datatable("Pwd".Set Datatable("Agent".xls”."open" Dialog("Login").3)=Login Dialog("Login"). “Sheet Name / Source Sheet” Ex: datatable.ReportEvent micFail.ReportEvent micPass.WinEdit("Agent Name:").WinButton("OK").ExportSheet “Path of File”.

Activate 3) dialog("text:=Login").Click Note: 1. Dialog.Methods Note2: If we feel one property information is not sufficient for recognizing the object uniquely. Login. WinEdit and WinButton – Test Objects 2. Set.Winbutton("text:=OK". 1. Note 3: .Set "mercury" 5) dialog("text:=Login"). text. attached text . b) Scripts are portable (we can run these scripts from any machine easily) c) Maintenance is easy (less amount of resources) d) We can start Test Execution process even though Application is not ready. Descriptive programming is basically 2 types. Password:. we provide objects information directly into the script. Setsecure.Descriptive Programming Descriptive Programming Entering / Providing objects information directly into the test script is called Descriptive Programming.Winedit("attached text:=Agent Name:").Property values or Logical Names of the Object 4. Example: 1) Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a. we no need to have Object Repositories.Winedit("attached text:=Password:").Property names 3.exe" 2) dialog("text:=Login").Set "gcreddy" 4) dialog("text:=Login"). Agent Name:. Activate."width:=60"). Dynamic Programming Static Programming In this style of script generation. then we can provide more properties information by separating with commas. Static Programming 2. Click . OK . In this method of script creation. Advantages: a) Descriptive Programming based Test scripts are faster in execution than Repository based Test scripts.

Winedit(Agent).icicibank. we can load the library file during run-time Syntax: ExecuteFile “Path of the Library file(.vbs)” After that create the Test Script using Constants Creating the Test Script using Constants: Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a. Agent="attached text:=Agent Name:" Const Pwd ="attached text:=Password:".exe" Dialog(Login).Set "mercury" Dialog(Login).Winedit(Pwd")."C:\Program Files\Internet Explorer".Set "asdf" Dialog(Login). then we can handle .com/" ------------------------------------------------------------------If we want maintain ‘Objects information’ in centralized location then we can use Constants.EXE".Page("title:=Google"). properties and values).Navigate "http://www. This feature is available in Tools Menu. Example 2: SystemUtil."open" Browser("title:=Google").If we want to get objects information (Test objects. Creating a Library file Place Constants in Notepad and save as .Run "C:\Program Files\Internet Explorer\IEXPLORE.Click Advantages: If we maintain Object Information in the centralized location. in local repository and in repository manager.Sync Browser("title:=Google"). we can use object spy feature. Steps: Creating Constants: Const Login="text:=Login". Ok="text:=OK" Note: we can declare no of Constants in a line by separating with Camas (.Winbutton(Ok). if we take other line then we have to use Const Statement again."".vbs file Associate the Library file to QTP (File->Settings->Resources-> Click add (+) icon-> Browse path of the Library file->Click Apply and click Ok buttons Otherwise.).Activate Dialog(Login).

Winbutton(oOK).Create oPassword=description. first we create description objects.jjperfumes. Note2: Dynamic programming is some difficult in preparation than static programming but maintenance is very easy. ------------------------------------------------------------------- Dynamic Programming In this style of script generation.Navigate http://www.Create Entering Properties Information into Objects oLogin("text").value="Login" oLogin("width"). ------------------------------------------------------ Examples: Handling similar/Duplicate Objects using Index Property SystemUtil.Winedit(oPassword).Click Note1: Create Description objects and put into one library file. Creating Properties Collection Objects Set Set Set Set oLogin=description.Run "C:\Program Files\Internet Explorer\IEXPLORE.value=204 oAgent("attached text").EXE" Browser("name:=Google").value=320 oLogin("height").exe" Dialog(oLogin). by associating that library file. provide properties information and use description objects in the test script.Set "mercury" Dialog(oLogin).value="OK" Generating Tests using Properties collection Objects Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.Create oAgent=description.modifications easily.Activate Dialog(oLogin).com/ .Create oOk=description.value="Agent Name:" oPassword("attached text").Sync Browser("name:=Google").value="Password:" oOk("text").Winedit(oAgent).Page("title:=Google"). we can generate tests.Set "gcreddy" Dialog(oLogin).

fragrance & cologne online").Link("innertext:=Register". fragrance & cologne online").page("title:=JJ Perfumes-Discount perfume cheap brand name perfumes.Click .Browser("name:=JJ Perfumes-Discount perfume cheap brand name perfumes."index:=0").

2. Standard check point Text check point Text area check point Bit map check point Data base check point Accessibility check point XML Check point (from Application) XML Check point (from Resource) Page check point 10. 3. 7. Table checkpoint Note 1: From 6 to 11 checkpoints are only for Web. Image checkpoint 11.Inserting Checkpoints Inserting Checkpoints Check point is a verification point. 5. . 4. 6. we can insert these checkpoints through standard checkpoint. it takes expected result from the user and compares with actual results during execution and provides test results. 9. Note 2: From 9 to 11 checkpoints are hidden checkpoints. 8. There are 11 Checkpoints available in QTP: 1.

Standard Checkpoint: It checks object property values.1. We can use this checkpoint for checking any property value. Navigation for Deleting standard checkpoint: Select Checkpoint statements and right click > choose delete option. Navigation for Editing standard checkpoint Select Checkpoint statement and right click > choose checkpoint properties option > modify the value > click Ok. Navigation for Inserting standard checkpoint Keep tool under recording mode > place cursor in desired location > Insert > check point > Standard checkpoint > Show the object > click okay > select property and enter expected results & click Ok and stop Recording. . Inserting Standard check points through active screen: View > Active Screen >place cursor in desired location >Place mouse pointer on active screen & right click> choose insert standard checkpoint option > click ok > enter expected result > click ok Note: Inserting Standard check points through keyword view same as in expert view.

c. ignore spaces. Navigation: Keep tool under Recording mode >Insert menu > checkpoint > Text checkpoint > Show the object > click ok > Select options (Match case. Through keyword view. 2) Text Checkpoint: It Checks object’s text property value in different ways. 3) Text Area Checkpoint: It checks the text area present in the application. exact match. b. text not displayed.Note: We can insert standard checkpoints in 3 ways. Through expert view. text not displayed. Through Active screen. ignore spaces. exact match. Navigation: Keep tool under Recording mode > Insert menu> Checkpoint > Text area checkpoint > Mark the area of text > select one or more options (Match case. a.) We can select one or more options > click ok & stop Recording.) .

Click ok and stop recording. . Accessibility check point: It checks whether the webpage in our web application is developed according to W3C (World Wide Web consortium) Rules and Regulations or not. we can compare complete bitmaps as well as part of the bitmaps. Bitmap checkpoint: It compares bitmaps. Note: here we do not need to put tool under Recording mode and we do not need AUT since data is from backend. 5. 6. Database checkpoint: It checks Content of the back end Database. 4. Navigation: Insert > checkpoint > Database checkpoint >choose “specify SQL statement manually” option >click next > click create > select machine data source > Select DSN (QT_flight32) > click ok > enter SQL statement (select * from orders) > finish > click ok. Navigation: Keep tool under Recording mode > Insert menu > Checkpoint > Bitmap checkpoint > show the Bitmap >click ok >select “check only selected area” option if we want to compare part of the bitmap > click ok >stop recording.

Navigation: Keep tool under Recording mode in web environment > insert menu > checkpoint (from application)> show the xml pages >click ok > stop Recording. we can customize. Result Criteria: a) b) c) If item is available but not according to W3C rules then fail. 8. XML Check point (from Resource) It checks content of the XML file. according to W3C rules then Pass. according to our requirements. If an item is available.It is a configurable checkpoint. . XML Check point (from Application) It checks content of the XML file. If an item is not available then result would be pass 7. Configuring accessibility checkpoint: Tools menu> options >web > advanced > check/uncheck items > click apply > click ok Invigilation: Keep tool under recording mode with web environment >insert>checkpoint>accessibility checkpoint>show the webpage>click ok>click ok>stop recording.

Images and Loading time in a web page. If XML file is an individual and path available. Navigation: Keep tool under Recording mode with web environment > Insert menu > checkpoint >standard checkpoint > show the image > select image > click ok > click ok >stop recording. Page checkpoint: It checks number of Links.Navigation: Insert menu > checkpoint >xml checkpoint (from resource) > browse path of the XML File > click ok > click ok. 9. It is a hidden checkpoint. . we can insert this through standard checkpoint. Note: 1. Navigation: Keep tool under Recording mode with web environment > Insert menu > checkpoint > Standard checkpoint >show the web page > click ok > click ok > stop recording. Image checkpoint: It checks Image property values. Note: 2. If XML file is part of web application. 10. and then we can go for inserting xml checkpoint from resource. separate path is not available then we can choose inserting XML checkpoints from application.

Navigation: Keep tool under Recording mode under web environment > Insert menu > checkpoint > standard checkpoint >show the web table > click ok >stop recording. . Table checkpoint: It checks content of the web tables.11.

4. Types of Output Values: 1. 5. it is located in QTP result window and can be retrieved later. 2. 3. The values can later be used as input at a different point in the run session or we can use as input for another test. 6. It is stored in run time data table.Inserting Output values Inserting Output Values It is a step in which one or more values are captured during test execution. Standard output value Text output value Text area output value Database output value XML output value (From Application) XML output value (From Resource) 1) Standard output value: .

. Navigation: Keep tool under recording mode > insert menu >output value > text area output value >Mark the text area >click modify the column name if necessary > click ok > again click ok > check in run time table after running it.We can use standard output values to output the properties values of most objects. When creating a text output value we can output a part of the objects text and we can also specify text before and after options.> check in runtime table after running it. Navigation: Keep tool under recording mode> Insert menu> output value > text output value > show the text >select one of the option(output text/text before/text after) > click modify if you want to change the column name > click ok > click ok. 3) Text Area output value: We can use text area output values to output text strings displayed within a defined area of the screen. Navigation: Keep tool under Recording mode > Insert menu >output value> standard output value > show the object > click ok > select property > modify the column name (if required) > click ok >click ok >stop recording. . 2) Text output value: We can use Text output values to output text strings displayed in an application.

Navigation: Insert menu> output value > Database output value> choose specify SQL statements manually >click next >click create >Select Machine Data source > Select Driver (QT_flight32) > click ok > enter SQL statement (select *from orders) > click finish > select data cells > click ok > Run and it will capture and see the results in run time table. Navigation: Keep tool under recording mode with web environment > Insert menu > output value > XML output value from application > Show the XML document > select elements > click ok >stop recording.4) Database output value: We can use Database output values to output the value of the contents of database cells. Navigation: Insert menu >output value> XML output value from resource > browse path of the XML file > click ok > select elements >click ok. 5) XML output value (from application): we can use XML output values to output the values of XML elements in XML documents. . 6) XML output Value (From Resource): We can use XML output values to output the values of XML elements in XML documents.

Through Data Table: QTP adds one data table (Spreadsheet) for every test. through this we can pass multiple values. It has 3 types of usage . Data Driven Testing: Testing the Same operation with multiple sets of test data.Dialog("Open Order").WinEdit("Agent Name:").Parameterization Passing parameters. Through Data Table 4."). Types of Parameterization: We can parameterize tests in several ways in QTP 1.Set Agent Dialog("Login").WinButton("OK"). 6.exe" Dialog("Login").Dynamic Test Data Submission: Through Loop Statements we can give strings also but every time user has to enter data.WinButton("Button").WinEdit("Edit").Activate Window("Flight Reservation"). Getting Test Data from front end objects. Dynamic Test Data Submission 3.Type micTab Dialog("Login").Close Next 3. We use parameterization in Data Driven Testing. Fetching Test Data directly from Databases (MSAcess. Through Loop Statements: We can use loop statements for passing sequential numbers & Logical Numbers. For x=1 to 3 Agent =inputbox("enter an Agent Name") Password=inputbox("enter a password") invokeapplication "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.Set orderno Window("Flight Reservation").WinEdit("Password:").WinCheckBox("Order No. 1.Click Next 2.WinButton("OK"). .WinEdit("Agent Name:"). we can use Data Table for Data Driven Testing. For orderno=1 to 10 step 1 ' for one increment step keyword is not mandatory Window("Flight Reservation").Dialog("Open Order"). Note: We can’t generate Strings.Dialog("Open Order").Set "ON" Window("Flight Reservation"). Through Loop Statements 2.SetSecure password Dialog("Login"). Oracle etc).Activate Dialog("Login").Click Window("Flight Reservation").Click Window("Flight Reservation"). Fetching Test Data directly from External files (Flat files & Spreadsheets) 5.

Entering test data directly into data table and use b.Close .Set Agent Dialog("Login").1) pwd=Datatable ("Password".a. Sheet id) Example: agent=datatable(“agent”. Agent = Datatable("Agent".SetSecure pwd Dialog("Login").1) Pass parameters.WinButton("OK"). Importing test data from external Flat files c.WinEdit("Agent Name:"). Importing test data from Data bases.WinEdit("Password:").Type micTab Dialog("Login"). Steps: Generate the basic test>open data table(View>Data Table) Click on column header>enter the name of the field (like this we can create number of columns) > Enter Data>connect the data to test (variable=datatable(“column name”. A.) Run the test.Click Window("Flight Reservation").Activate Dialog("Login"). Importing test data from external Spread sheets d.exe" Dialog("Login").1) invokeapplication "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.WinEdit("Agent Name:"). Entering test data directly into data table and use.

c. Creating Tables: Select Create table in design view>Enter field name(Agent)and Select data type(text) Like this we can create number of fields>save&enter table name. Start programs>MS Office>MS Access>file >new>Select blank Database>enter name of the database>Save with mdb extension. 1. but first we have to create /get the DSN(Data source Name)& we have to use SQL Commands. D. Importing test data from Data bases: Through Data table we can import Test Data from Data bases. Importing test data from external files: Open Data Table (view>Data table)>place mouse pointer on data table and right click>file>import from file>Click ok>Browsw path of the file(it imports data from the flat file) Connecting Test Data to QTP Test as above and run the test. Creating a Test Database: open MS Access (or we can use any other database). Entering Data into Tables: Select table>enter the data. . Importing test data from external Spread sheets: Open Data Table (view>Data table)>place mouse pointer on data table and right click>file>import from file>Click ok>Browse path of the excel sheet (it imports data from the excel sheet) Connecting Test Data to QTP Test as above and run the test.b.

1) myfile.eof=true SystemUtil.provider=("microsoft.WinEdit("Password:").open "C:\Documents and Settings\pooja\My Documents\trigun.WinEdit("Password:")."C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\".filesystemobject") Set myfile=fso.connection") Set rs=createobject("adodb.Set s(0) Dialog("Login"). Note: DSN Creation is one time activity. myfile Set fso=createobject("scripting.txt".""."open" Dialog("Login").jet.atendofline <> true x=myfile.fields("password") Dialog("Login")."@") SystemUtil.Close Wend Fetching Test Data directly from Excel Sheets Fetching Test Data directly from Databases Option explicit Dim con. by using the DSN we can get data for number of tests.opentextfile("d:\trigun.fields ("agent") Dialog("Login").SetSecure S(1) Dialog("Login").movenext loop .Creating DSN & importing data Navigation: view>data table>Place mouse pointer on Data table>sheet>import>from database(Database query wizard opens)>choose ‘specify SQL statements manually>click next >click create>click new>select driver type>click next >browse path to store> enter DSN Name>Click Save>click next>click finish>select>browse the database& select>click ok>click ok>select DSN>click ok>enter SQL statement (select *from login)>click finish.Activate Dialog("Login").oledb.mdb" rs.4.WinEdit("Password:").exe".Type micTab Dialog("Login").Activate Dialog("Login").SetSecure rs.readline S=split(x.Close rs. Fetching Test Data directly from Flat files Dim fso.Type micTab Dialog("Login").WinEdit("Password:").WinEdit("Agent Name:").open "select * from login".0") con.exe".WinEdit("Agent Name:").skipline While myfile."open" Dialog("Login"). 4.""."C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\".rs Set con=createobject("adodb.recordset") con.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.WinEdit("Agent Name:").con do until rs.Type micReturn Window("Flight Reservation").Type micReturn Window("Flight Reservation").Set rs.WinEdit("Agent Name:").

Page("Yahoo! Toolbar"). but QTP does not wait up to maximum time unnecessarily. Inserting Synchronization points. after completion of the current operations. Sync Method: (only for WEB) Waits for the browser to complete current navigation. it does not wait up to maximum time.value. Increasing Tool default synchronization time. 4. In order to get proper results in between QTP & AUT synchronization is required. Syntax: Wait(time in seconds) Note: If we insert wait statements QTP waits up to maximum time even though operation is completed. After completion of one statement execution it goes to next statement immediately. 2.Synchronization It is a process of matching the speeds of both QTP and AUT in order to get proper execution and results. Note: if we insert Synchronization points. Inserting Wait statements. but AUT takes less time for some operations execution and more time for some operations execution. Exist Property Inserting Wait Statements: We can insert wait statements in our test in order to make QTP to wait until AUT completes current operation. it goes to next step immediately. Inserting Synchronization points: Place cursor in desired location>keep tool under recording mode>Insert menu>Synchronization point >show the object >click ok>select property name & Value(True)>enter time in Milli seconds>click ok>Stop recording.Sync Ex: Browser("Yahoo! Toolbar").time in milli seconds. Where Synchronization is required: During test execution QTP gives instructions one by one with same speed.waitproperty “property name”. Syntax: Object Hirearchy. Increasing Tool default synchronization time: Navigation: File>settings>run tab>increase object synchronization time out>apply>ok Note: If we increase QTP tool default time that can be applied for all statements in the test. 1. There are several methods available in QTP for synchronization.Sync Selecting an appropriate Method: . 3. Sync Method (Only for WEB) 5. Syntax: object hierarchy. that time we may not get proper execution and results.

3.1. 2. . Suppose in our test more statements are taking more time for execution then selecting “increasing tool time out” . Above two are local features but wait statement is Vbscript feature. even though some drawbacks are there in using wait statement. Suppose in our test one or more statements only are taking more time for execution then selecting “Inserting synchronization method” is better. it is better to use wait statement in functions.

Activate services.exe"."open" Dialog("Login").Activate Dialog("Login")."C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\". ST=Timer’ It returns elapsed time since 12:00 AM Mid night in seconds Example: . we can measure using these transaction point (Start and End) Syntax: Services.Inserting Transaction Points Inserting Transaction Points QTP is providing a Utility object called Services for measuring transaction time Suppose.StartTransaction “Transaction Name” Statements -----------Services.EndTransaction “Transaction Name” Note: these options (Start and End Transactions) available in QTP tool Insert menu Example: services.Click Window("Flight Reservation")."". we want to measure how much time that one test or part of the test is taking for execution/running.Set "naga" Dialog("Login").SetSecure "4baf50f18b0ae0d5f5425fe760653e96da50bde7" Dialog("Login"). that can be used for measuring transaction time.WinEdit("Agent Name:").WinButton("OK").EndTransaction "Login" Note: We can insert number of transaction points in a test Using Timer Function ‘Timer’ is a VB Script Built-in function.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.StartTransaction "Login" SystemUtil.WinEdit("Password:").

you can take any variable."open" Dialog("Login").Activate Dialog("Login").Click Window("Flight Reservation").SystemUtil.Activate ET=Timer TT=ET-ST msgbox TT Note: here ST.WinEdit("Agent Name:"). ET and TT are variables. I used: ST for Start Transaction ET for End transaction TT for Transaction Time .Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.WinButton("OK")."C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\".Set "naga" Dialog("Login")."".WinEdit("Password:").SetSecure "4baf50f18b0ae0d5f5425fe760653e96da50bde7" Dialog("Login").exe".

. Before we open the Step Generator to define a new step.Step Generator Step Generator (F7) Step Generator is a feature of QTP. we first select the category for the step operation (test object. and internal script functions For example. in function libraries. Hover. In the Step Generator dialog box we can define steps that use: Test object operations (tests only) Utility object operations Calls to library functions (tests only). Navigation: Insert menu->Step Generator Or Use Shortcut key F7 The Step Generator enables us to add steps by selecting from a range of context-sensitive options and entering the required values. we can add a step that checks that an object exists. Note: we can use the Step Generator to insert steps in tests and function libraries. or function) and define the arguments and return values. Utility object or function) and the required object or the function library. used for generating the Recordable and Non-Recordable steps. or to access the list of library functions. We can parameterize any of the values in our step. We can open the Step Generator from the Keyword View. we first select where in our test the new step should be inserted. or Active Screen. We can then select the appropriate operation (method. parameterizing them if required. VBScript functions. Expert View. we cannot use the Step Generator to access test object names or collections. Library of Functions. property. We can continue to add further steps at the same location without closing the Step Generator. After we open the Step Generator. The Step Generator then inserts a step with the correct syntax into y test. or that stores the returned value of a method as an output value or as part of a conditional statement.

it makes a good delimiter. For example. Although most script writers use the single quotation mark. the single quotation mark is a valid VBScript character that has uses beyond delimiting comments. both of the following lines of code are valid comments: ' This is a comment using a single quote delimiter. This can be a problem if we use an automated procedure to extract comments from a script. such a procedure might also retrieve items that are not comments. it makes the comment stand out from the rest of the text. VBScript allows two delimiters: the single quotation mark (') and the REM statement. Because we are less likely to use '* anywhere else in our script.Adding Comments Adding Comments to Scripts Comments are statements that are ignored by the script host when the script runs. First. REM This is a comment using the REM statement as a delimiter. . a single quotation mark by itself can be difficult to see at times. you might consider following the single quotation mark with an asterisk when commenting your code: '* This is another comment. we must preface each comment with a comment delimiter. To ensure that the script host does not attempt to interpret a comment as a command. This approach has two advantages over the single quotation mark alone. Second.

" End If '* Map drive Z. If Err.Number <> 0 Then '* Check to make sure the operation succeeded.CreateObject("WScript.Number <> 0 Then Err.Always include comments on separate lines except for comments that accompany the declaration of a variable. comments are placed on the same line as a VBScript statement.Clear Wscript.MapNetworkDrive "Z:". WshNetwork.Clear Wscript. Comments included on the same line as a VBScript statement (end-of-the-line comments) are valid but can be difficult to read. while in the second half of the script. "\\RemoteServer\Public" '* Check to make sure the operation succeeded. compare the two commenting styles in the following script snippet. For example. ----------------------------------------------On Error Resume Next Set WshNetwork = WScript.Network") WshNetwork. "\\RemoteServer\Public" '* Map drive Z. If Err. the comments are placed on separate lines.Echo "The drive could not be mapped. Most people find it easier to quickly identify the comments used in the second half of the script. in the first half of the script.Echo "The drive could not be mapped." End If .MapNetworkDrive "Z:". Err.

you should include an overview that describes the script. erroneous comments. especially through reference arguments. Arguments passed to a procedure should be described when their purpose is not obvious and when the procedure expects the arguments to be in a specific range. resulting in unnecessary comment maintenance work. and procedures should be named clearly to ensure that inline comments are only needed for complex implementation details. This description should not describe the implementation details (how it does it) because these often change over time. At the beginning of your script. Variables. or worse. dialog boxes. procedures. should also be described at the beginning of each procedure. and other system dependencies. controls. Sometimes a piece of pseudocode describing the algorithm can be helpful. .----------------------------------------------Code Commenting Conventions All procedures should begin with a brief comment describing what they do. Return values for functions and variables that are changed by a procedure. The code itself and any necessary inline comments describe the implementation. enumerating objects. Procedure header comments should include the following section headings. Section Heading: Comment Contents: Purpose: Assumptions: Remember the following points: Every important variable declaration should include an inline comment describing the use of the variable being declared. algorithms.

Debugging Tests Debugging Tests Debugging is a process of executing the script or a program in a User designed fashion with some temporary break points in order to identify the errors. 2) Step Over (Short cut key F10): a) It executes one statement at a time after execution starts b) It executes all functions statements at a time Note: After opening the function. Debug Commands: 1) Step Into (short cut key F11): a. it opens the function. For debugging. QTP is providing debug commands and breakpoints. It executes one statement at a time. after that it executes one statement at a time. c. If it is function call. It starts execution b. if we use step over it executes one statement at a time only. .

3) Step Out (shift +F11): It executes all remaining statements in a function at a time.c a=100 b=200 c=a+b msgbox c msgbox "hello" Call hyderabad msgbox "bye bye" Note: Create a script and work on it Break Point: This feature is used for breaking the execution temporarily. Navigation: Place cursor in desired location >Debug menu>Insert/Remove break point Or Use short cut key (F9) . Ex: Dim a.b.

Or Place mouse pointer before the statement and click. Command Note: Through Debug Viewer Pane. Variables 3. modifying or setting the value of the variables during the execution break with the help of 3 Tabs. Debug viewer Pane: It is used for viewing. We can change Values of Variables temporarily. We can watch variables whether the variables are taking correct values or not at a specific point of time. 1. Watch 2.z x=10 y=20 z=x+y msgbox z msgbox "Hello" x=35 .y. there we can use breakpoints. Ex : Dim x. Note: If we want to execute Some part of the Test Script at a time and some other part of the test script step by step.

.y=67 z=x*y msgbox z msgbox "bye bye" Navigation: View menu > Debug Viewer > Use step into feature.

Doc). we can define our own results. For defining our own results. QTP is providing an utility object called "Reporter" by using reporter. then QTP Provide result window.Analyzing Test Results & Reporting Analyzing the Test Result is not a responsibility of QTP."message" Example" Reporter.ReportEvent status of the Result. suppose if we use flow control statements (conditional and Loop statements).Message . Res-Result step "Login operation Successful"."Res"."Result Step". User (Test Engineer) has to analyze the test result. XML and PDF formats.Utility object ReportEvent-Method micPass-Status of the Result. Status of the Result: QTP has 4 types of result status a) Pass b) Fail c) Done d) Warning Defining our own Result: Generally QTP provides. then we have to define our own result. QTP Result Window: After Running/Executing a test. Syntax: Reporter. and send defect reports. It provides test wise result only."Login operation Successful" exaplanation: Reporter. Note: QTP doen't provide batch wise test result. if we use qtp tool features like checkpoints.ReportEvent micPass. HTML. After Running Tests. we export test result from result window in Document (. if we execute test batches. test results.

Status of the Result: 1) Pass -micPass or 0 2) Fail -micPass or 1 3) Done.micDone or 2 4) Warning.micDone or 3 .

then we can send defects directly from QTP result window. . various methods for crating and enhancing Tests.Reporting Defects QTP is an Object based Test tool. After analyzing results. QTP Provides. In between QTP and Quality Center back to back integration is available. If we are using Bugzilla or Zera or PR-Tracker like Bug Tracking tool. if we find any mismatches sending defects through the Bug tracking tool (Every Bug Tracking tool has its own defect report template) If we are using Quality center for Test management. If we are using QTP for Functional Test Automation and Defect management manual. After Running Tests. We can create and execute tests using QTP. Result Exporting facility also available in QTP Result window. then after analyzing results. Any how Analyzing Results is the Responsibility of Test Engineer after running tests. we can report defects in various methods. QTP provides result in Result window and also provides a facility to define our own Results. then entering defect details in company prescribed format and sending.

Splitting an action: Navigation: Place cursor in desired location>Edit menu>action>split action>Enter Action 1 name & action 2 name. . Prepare Scripts for those actions. Purpose of Actions: For understandability For reusing components Types of Actions: 1) Non Re usable actions 2) Re usable actions 3) External actions Operations on Actions: • Creating Actions • Splitting Actions • Renaming Actions • Deleting Actions • Calling an Action • Copying an Action • Making an Action Reusable/Non Reusable Creating an Action: Insert>call to new action>enter name of the action>click ok Steps: 1.delte) 2. Create required actions(ex login. insert.Actions Action: Set of Statements for perfoming a Task(s) We divide our test into actions to streamline the process of testing.

Split into meaningful actions.Steps: 1. Deleting Actions: Select desired action in action drop down box>edit menu>action>delete action>confirm deletion. Note: we can edit this action. Note: U can’t edit Copying an action: Insert>call to copy of action>browse path of the test>select desired action>click ok. . Generate total test in the default action 2. Note: At a time we can split one actions into 2 actions. Making an action reusable: Select Non Reusable action >edit >action>action properties>check reusable action check box >click ok. Calling an action: Insert>call to existing action>browse path of the test>select desired action>click ok. Renaming actions: Select desired action in action drop down box> edit menu>action>rename action>modify the name>click ok.

3) msgbox x ' Output: H92 x=Left(9247837478.VB Script String Functions String Functions 1) Left Function Returns a specified number of charectors of a given string from left side Syntax: variable=Left(string.5) msgbox x ' Output: 92478 val=#10-10-10# x=Left(val.3) msgbox x ' Output: 10/ .x val="Hyderabad" x=Left(val.Lengh) Example: Dim val.3) msgbox x ' Output: Hyd val="9247837478" x=Left(val.1) msgbox x ' Output: 9 val="H92yderabad" x=Left(val.

3) msgbox x ' Output: bad val="9247837478" x=Right(val.x val="Hyderabad" x=Right(val.5) msgbox x ' Output: /2010 3) Mid function Returns a specified number of charectors of a given string Example: Dim val.5) msgbox x ' Output: rabad .5.x val="Hyderabad" x=Mid(Val.3) msgbox x ' Output: rab val="Hyderabad" x=Mid(Val.5) msgbox x ' Output: 37478 val=#10-10-10# x=Right(val.2) Right Function Returns a specified number of charectors of a given string from Right side Example: Dim val.1) msgbox x ' Output: 8 val="H92yderabad" x=Right(val.3) msgbox x ' Output: bad x=Right(9247837478.

x val="Hyderabad" x=StrReverse(val) msgbox x 'Output dabaredyH val="001" x=StrReverse(val) msgbox x 'Output: 100 val=1002 x=StrReverse(val) msgbox x 'Output: 2001 val=#10-10-10# x=StrReverse(val) msgbox x 'Output: 0102/01/01 x=StrReverse("Hyderabad") msgbox x 'Output: dabaredyH x=StrReverse(100) .1) msgbox x ' Output: H92yderabad x=Mid(9247837478.5) msgbox x ' Output: 837478 val=#10-10-10# x=Mid(val.6.5) msgbox x ' Output: 0/2010 4) StrReverse retuns reverse value of a string Example: Dim val.5) msgbox x ' Output: 37478 val="H92yderabad" x=Mid(val.val="9247837478" x=Mid(val.

str2.1) msgbox x 'Output 0 str1="india" str2="INDIA" x=StrComp(str1.x str1="India" str2="India" x=StrComp(str1.1) msgbox x 'Output -1 str1="Indian" str2="Ndia" x=StrComp(str1.1) msgbox x 'Output 1 str1=100 str2=100 .str2. returns 1(one) b) String 2 greater than string 1.1) msgbox x 'Output -1 str1="Indian" str2="India" x=StrComp(str1.str2. returns -1 Example: Dim str1.msgbox x 'Output: 001 5) StrComp Function It compares two string (Binary and textual) if a) Both are equal.str2. returns 0(zero) b) String 1 greater than string 2.1) msgbox x 'Output 0 str1="India" str2="Indian" x=StrComp(str1.str2.str2.

x val="HYDERABAD" x=Ucase(val) msgbox x 'Output HYDERABAD .1) msgbox x 'Output -1 6) Lcase function Coverts Upper case values into Lower case Dim val.x val="HYDERABAD" x=Lcase(val) msgbox x 'Output hyderabad val="Hyderabad" x=Lcase(val) msgbox x 'Output hyderabad val="HederabaD" x=Lcase(val) msgbox x 'Output hyderabad val="hyderabad" x=Lcase(val) msgbox x 'Output hyderabad x=Lcase("HYDERABAD") msgbox x 'Output hyderabad 7) Ucase function Coverts Lower case values into Upper case Example: Dim val.x=StrComp(str1.1) msgbox x 'Output 0 str1=100 str2=101 x=StrComp(str1.str2.str2.

val="Hyderabad" x=Ucase(val) msgbox x 'Output HYDERABAD val="HederabaD" x=Ucase(val) msgbox x 'Output HYDERABAD val="hyderabad" x=Ucase(val) msgbox x 'Output HYDERABAD x=Ucase("HYDERABAD") msgbox x 'Output HYDERABAD .

User defined variables: Variables that we predefine in the active external environment variables file.Activate Dialog("Login"). Types of Environment variables: 1.Click Creating user defined environment variables: Navigation: .Run ProductDir & app Dialog("Login"). we can access from all tests but these are designed as read only.WinEdit("Agent Name:"). Built in variables: These are system defined variables. If we declare as local variables in number of tests.WinEdit("Password:"). Usage of environment variables: Syntax: Variable = Environment(“environment variable name”) Ex: X=Environment (“ActionName”) Msgbox x Example Script: ProductDir =environment ("ProductDir") app= "\samples\flight\app\flight4a.WinButton("OK").SetSecure "4b3c86f2107ff565cc195ba6c24739091b656407" Dialog("Login").exe" Systemutil. 2. We can create as many files as we want and we can change values of variables. modifications are difficult.Environment Variables Environment Variables in QTP These are global variables.Set "kajal" Dialog("Login"). if you want to use some variables globally (From number of tests) declaring as global variables is better.

. save with xml extension > click ok.loadfromfile”path of the xml file” Usage of user defined Environment variables: Associate environment file to current test: Variable = Environment (“Variable Name”) X=environment (“city”) Msgbox x Modifying Environment files: Select XML file>open with notepad>modify the values>Save.File > settings > Environment > select variable type as user defined > click add icon (+) > enter variable name & Value > click ok (like this we can create number of variables) > click export > browse path & enter file name. Or We can load environment file directly Environment. Associating environment variable file: Navigation: File > settings >Environment > select variable type as user defined > check “load variables and values from the external file” > browse path of the xml file > click apply & ok.

They are often used within matching. Ways of Regular Expressions: . Where we use: o Defining the property values of an object in Descriptive programming for handling dynamic objects o For parameterizing a step o creating checkpoints with varying values Using Regular Expressions in QTP: We can define a regular expression for a constant value.Regular Expressions Regular Expressions in QTP What is Regular Expression? It is a way of representing data using symbols. or a property value in Descriptive programming. We can define the text string as a regular expression. when creating a text checkpoint to check that a varying text string is displayed on our application. we can set the expected value of an object's property as a regular expression so that an object with a varying value can be verified. We can define a regular expression in standard checkpoint to verify the property values of an object. searching or replacing algorithms. For XML checkpoints we can set attribute or element values as regular expressions. a Data Table parameter value. Regular Expressions in QTP: Regular expressions can be used in QTP for identifying objects and text strings with varying values. an Environment parameter value.

It can be used in conjunction with a special character to indicate that the next character be treated as a literal character. c) Matching Any Single Character in a List: Square brackets instruct QTP to search for any single character within a list of characters. we can use square brackets ([ ]) with the hyphen (-) character. w. Alternatively. or 1869. Example: For matching any year in the 2010s. e) Matching Any Single Character within a Range: To match a single character within a range. it instructs QTP to match any character in the list except for the ones specified in the string.a) Backslash Character: A backslash (\) can serve two purposes. Example: [^ab] Matches any character except a or b. or welcome followed by a space or any other single character. if the backslash (\) is used in conjunction with some characters that would otherwise be treated as literal characters.) instructs QTP to search for any single character (except for \n). Ex: welcome. caaaaaar. Ex: To search for the date 1867. enter: 186[789] d) Matching Any Single Character Not in a List: When a caret (^) is the first character inside square brackets. such as the letters n. b) Matching Any Single Character: A period (. Matches welcomes. or d. and cr g) Matching One or More Specific Characters: . t. enter: 201[0-9] f) Matching Zero or More Specific Characters: An asterisk (*) instructs QTP to match zero or more occurrences of the preceding character. welcomed. 1868. the combination indicates a special character. For example: ca*r Matches car.

A plus sign (+) instructs QTP to match one or more occurrences of the preceding character. or before a newline character. + .* Matches start. starter. . or after a newline character. l) Matching the End of a Line: A dollar sign ($) instructs QTP to match the expression only at the end of a line. i) Grouping Regular Expressions: Parentheses (()) instruct QTP to treat the contained sequence as a unit. ? . 0-9. m) Matching Any AlphaNumeric Character Including the Underscore: \w instructs QTP to match any alphanumeric character and the underscore (A-Z. a-z. For example. but not cr. k) Matching the Beginning of a Line: A caret (^) instructs QTP to match the expression only at the start of a line. o) Combining Regular Expression Operators: We can combine regular expression operators in a single expression to achieve the exact search criteria we need. Using groups is especially useful for delimiting the argument(s) to an alternation operator ( | ) or a repetition operator ( * . _). but nothing else. we can use a combination of brackets and an asterisk to limit the search to a combination of non-numeric characters. starting. { } ). h) Matching Zero or One Specific Character: A question mark (?) instructs QTP to match zero or one occurrences of the preceding character. just as in mathematics and programming languages. start. j) Matching One of Several Regular Expressions: A vertical line (|) instructs QTP to match one of a choice of expressions. started. For example: ca?r Matches car and cr. n) Matching Any Non-AlphaNumeric Character: \W instructs QTP to match any character other than alphanumeric characters and underscores. For example: ca+r Matches car and caaaaaar. and so forth.

GetFolder(strCurrentDirectory) Set colFiles = objFolder.Echo objFile.FileSystemObject") Set objShell = CreateObject("WScript. 2 digits.Shell") strCurrentDirectory = objShell.Files Set objRE = New RegExp objRE. It provides simple support for defining regular expressions.Test(objFile.CurrentDirectory Set objFolder = objFS.For example: [a-zA-Z]* To match any number between 0 and 1200.Arguments(0) For Each objFile In colFiles bMatch = objRE.IgnoreCase = False objRE.Pattern = WScript. or 4 digits between 1000-1200. 3 digits. we need to match numbers with 1 digit. Regular Expression Object Properties and Methods: Properties: a) Global Property b) IgnoreCase Property c) Pattern Property Methods: a) Execute Method b) Replace Method c) Test Method Regular Expressions Examples: 1) Match File Names in a Directory against Regular Expression Set objFS = CreateObject("Scripting.Name) If bMatch Then WScript. ([0-9]?[0-9]?[0-9]|1[01][0-9][0-9]|1200) RegExp object VB Script is providing RegExp object for defining Regular expressions. The regular expression below matches any number between 0 and 1200.Global = True objRE.Name End If Next .

2) Match Content in a File against a Regular Expression strFileName = "E:\gcreddy.txt" Set objFS = CreateObject("Scripting.Arguments(0) Set colMatches = objRE.FirstIndex & " matched " & objMatch.IgnoreCase = False objRE.Echo strFileContents objTS.Pattern = WScript.Execute(strFileContents) WScript.Echo vbNewLine & "Resulting Matches:" For Each objMatch In colMatches WScript.Echo "Searching Within: " WScript.Global = True objRE.Close Set objRE = New RegExp objRE.Value Next .Echo "At position " & objMatch.OpenTextFile(strFileName) strFileContents = objTS.FileSystemObject") Set objTS = objFS.ReadAll WScript.

Navigation:  Select Tools Menu . We can manage the virtual objects defined on our computer using the Virtual Object Manager.Virtual Object Configuration Virtual Object Configuration Virtual Object Configuration: Virtual Object Configuration is a process of making the QTP to treat a specified area or a user defined object as Virtual Object. Virtual objects enable us to create and run tests on objects that are not normally recognized by QTP.

      o o     Go to Virtual objects Select ‘New Virtual Object’ option Click Next Mark the area in the Application with help of mark object button Click next Select one of the following options Entire Parent hierarchy Parent only Click on Next Specify the Desired object name Specify the Desired collection name Click finish Virtual Object Manager: Virtual object Manager feature enable us to create and manage Virtual Objects .

QTP is providing a separate Tool called Test Batch Runner. Open 'Test batch Runner' Tool and Form Batches. Run or Execute Test Batches from Test Batch Runner. Note: QTP doesn’t provide Batch wise result. 2). Forming a Test Batch: Launch Test Batch Runner. 3) Provide permission to 'Test batch Runner' to run tests 4). Create Individual Tests and Run once. For performing Batch Testing.Batch Testing Batch Testing or Batch Execution Executing a group of Tests or series of tests at a time is known as Batch Testing or Batch Execution. Steps for Batch Testing: 1). . Navigation: Start>program>quicktest professional>Tools>Test Batch Runner>File>new>batch>add>browse path of the test (like this add number of tests)>save with MTB extension (Module test batche)>close test batch runner. 5) View Test wise Result in 'Test Result Viewer'.

Restart.>Next .) (ii) Popup Window. function Call. we can use Recovery Scenario Manager.>Save the scenario in specified location with “. There are (4) Types of events such as: (i) Application Crash An open application fails during Test Run.>Next .>Finish .>Select “Popup . To handle unwanted popups.>Select Option .Running or Executing a Test Batch Open Test Batch Runner Tool Navigation: File>open>browse path of the test batch>batch>run Note: Test Batch Runner launches QTP Tool. Note: Allowing other products to Run Tests. QTP runs Tests one by one. Mouse Operation.qrs” (qrs stands for QuickTest Recovery Scenario.> Click Next .>Select selected executable application->Next ->Select Recovery Operation [Keyboard.>If you want to check Add another operation else uncheck->Next . Navigation: Resources Menu -> Recovery Scenario Manager-> Click New. error must be known the occurrence is unknown. For good recovery. Navigation: Tools>Options>Run>check allow other mercury products>apply & Ok Executing partial Test Batch Open Test Batch Runner >open Test Batch>Select or deselect tests>run test batch.>Close . Recovery Scenarios Recovery Scenario Manager To recover from unexpected events and errors that are occurred in the test environment during run session. Close Application Process.>Enter Scenario Name ->Next. Microsoft Windows] ->Next .> Select Application Crash as Trigger event->Next . Navigation: Resources Menu ->Recovery Scenario Manager ->New .

>Select function call as Recovery Operation ->Next [Open Notepad ->Save empty file with . Stop the Test Run] �� Select Option �� Next �� Enter Scenario Name �� �� Save the scenario with Finish �� Record required Recovery Operation [Click “. You can specify property values for each object in the hierarchy.vbs extension] -> Browse the .vbs fie path ->Next ->Uncheck Add another Recovery Operation . Restart current test run. Proceed to Next step.qrs” �� ok. Stop the Test Run] -> Next-> Enter Scenario Name -> Next -> Select Option -> Finish -> Save the scenario with “. Click Cancel] take the script into function -> Save the library file -> Click Run .false)->click next -> Select function call as Recovery Operation -> Next [Open Notepad -> Save empty file with .> Finish ->Save the scenario with “.>Select function call as Recovery Operation ->Next [Open Notepad ->Save empty file with .>Next -> Select Post-Recovery Test Run Option [Repeat current step and continue. Restart current test run. Proceed to Next Action.Window” as Trigger event ->Next ->Click on Hand Icon . Navigation : Resources Menu ->Recovery Scenario Manager ->New .vbs fie path -> Next -> Uncheck Add another Recovery Operation -> Next -> Select Post-Recovery Test Run Option [Repeat current step and continue. A step in your test does not run successfully then Test Run Error can be raised. Proceed to next test iteration.>Next . Click Cancel] take the script into function ->Save the library file ->Click Run (iii) Test Run Error. Proceed to Next step.>Select Option . Proceed to Next Action. Proceed to next test iteration.>Next . The property values of an object in your application match specified values.qrs” -> Record required Recovery Operation [Click ok.>Browse the .vbs fie path ->Next ->Uncheck Add another Recovery Operation . Proceed to Next Action. Proceed to Next step. Proceed to next test iteration.>Next .> Select Post-Recovery Test Run Option [Repeat current step and continue. Click Cancel] take the script Click Run Save the library file �� into function �� (iv) Object State. Restart current test Next run.>Show unwanted window with Hand icon ->Next ->Next .>Select “Testrunerror Window” as Trigger event ->Next ->select any error o .vbs extension] ->Browse the . Navigation: Resources Menu -> Recovery Scenario Manager -> New -> Next -> Select “Object state Window” as Trigger event -> Next -> Click on Hand Icon -> Show object with hand icon -> Next -> Next->select object property with value (enabled .qrs” ->Record required Recovery Operation [Click ok.>Next . Stop the Test Run] ->Next ->Enter Scenario Name ->Next .vbs extension] .

File System Operations File System Operations File System: Its an operating system feature. modify. view and delete.method syntax with a rich set of properties. . drives.filesystemobject and some methods for performing file systems operations File System Object Model: The File System Object (FSO) model provides an object-based tool for working with folders and files. methods.folders and files VB Script is providing an object called scripting. and events to process folders and files. it allows users to create. We can also employ the traditional Visual Basic statements and commands. It allows us to use the familiar object.

contained in the Scripting type library (Scrrun. We may not want to have such overhead. The FSO model makes processing files much easier as well.dll). such as their names and the date they were created or last modified. our primary goal is to store data in an efficient. To manipulate binary files.The FSO model gives our application the ability to create.FolderExists(strFolder) Then . It also enables us to get information about folders. doing so adds a significant amount of overhead to our application. insert and change the data. The FSO model. use the FileOpen Function with the Binary keyword. In this case. and output (read) the data. We need to be able to create files. strFolder strFolder="D:\Documents and Settings\gcreddy\Desktop\Dibyalok" Set fso=createobject("scripting.filesystemobject") If fso. move. Examples: 1) Create a folder Dim fso. alter.filesystemobject") fso. or to determine if and where particular folders exist. easy-to-access format. strFolder strFolder="D:\Documents and Settings\gcreddy\Desktop\Dibyalok" Set fso=createobject("scripting. however.CreateFolder(strFolder) 2) Create a folder Dim fso. and delete folders. supports the creation and manipulation of text files through the TextStream object. or our data access requirements may not call for the extra functionality associated with a full-featured database. Although we can store data in a database. the FSO model does not support binary files. When processing files. storing our data in a text file or binary file is the most efficient solution.

Activate Dialog("text:=Login").Set myField(0) Dialog("text:=Login").") SystemUtil.AtEndOfStream myLine=myFile. 2-Write & 8-Append myFile. '********************************************************* 'Test Requirement: Data Driven Testing by Fetching Test data directly from a Text file. myField Set objFso=CreateObject("Scripting.ReadLine myField=Split(myLine.Set myField(1) wait 2 Dialog("text:=Login").FileSystemObject") Set myFile=objFso.OpenTextFile("C:\Documents and Settings\gcr.WinEdit("attached text:=Agent Name:").txt (Test Data) 'Test Flow: 'Creating an Automation Object in FileSystem class 'Opening the External Test Data file using the Object 'Read the Data & Split the Data 'Generating the Login Operation 'Pass Parameters '******************************************************** Dim objFso.exe" Dialog("text:=Login").".Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.msgbox "Folder already exists" else fso. 'Author: G C Reddy 'Date of Creation: 13-08-2010 'Pre-requisites: 'vinod.WinEdit("attached text:=Password:").WinButton("text:=OK"). myFile.Close .Click Window("text:=Flight Reservation").txt". myLine.SkipLine Do Until myFile.CreateFolder(strFolder) End If 3) Data Driven Testing by fetching Test data directly from a Text file.1) '1 for Read.GCRC9A12FBD3D9\Desktop\vindod.

True 4) Checking weather the folder available or not. strDirectory strDirectory = "D:\Gcreddy" Set objFSO = CreateObject("Scripting.Close Set objFso=Nothing for more Examples visit: File System Scripts File System Scripts 1) Create a Folder Option Explicit Dim objFSO.FileSystemObject") oFSO.CreateFolder(strDirectory) 2) Delete a Folder Set oFSO = CreateObject("Scripting. "C:\jvr".CopyFolder "E:\gcr".FileSystemObject") Set objFolder = objFSO.DriveLetter Next . if not creating the folder Option Explicit Dim objFSO.Filesystemobject") oFSO.Loop myFile.DeleteFolder("E:\Gcreddy") 3) Copying Folders Set oFSO=createobject("Scripting.FolderExists(strDirectory) Then Set objFolder = objFSO.Drives For Each oDrive in colDrives MsgBox "Drive letter: " & oDrive. objFolder. objFolder.CreateFolder(strDirectory) end if 5) Returning a collection of Disk Drives Set oFSO = CreateObject("Scripting.GetFolder(strDirectory) msgbox strDirectory & " already created " else Set objFolder = objFSO.FileSystemObject") Set colDrives = oFSO. strDirectory strDirectory = "D:\Gcreddy" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.

1) Do Until objFile.GetDrive("C:") MsgBox "Available space: " & oDrive.txt") End if 3) Reading Data character by character from a Flat File Set objFSO = CreateObject("Scripting.txt") 2) Checking weather the File is available or not.AtEndOfStream strCharacters = objFile.FileExists(strDirectory & strFile) Then Set objFolder = objFSO.FileSystemObject") Set oDrive = oFSO. if not creating the File strDirectory="E:\" strFile="Gcreddy.txt".CreateTextFile("E:\Gcreddy.Read(1) msgbox strCharacters Loop 4) Reading Data line by line from a Flat File Set objFSO = CreateObject("Scripting. 1) Do Until objFile.FileSystemObject") Set objFile = objFSO.AvailableSpace Flat File Scripts Flat File Scripts 1) Creating a Flat File Set objFSO = CreateObject("Scripting.txt" Set objFSO = CreateObject("Scripting.AtEndOfStream strCharacters = objFile.6) Getting available space on a Disk Drive Set oFSO = CreateObject("Scripting.OpenTextFile("E:\Gcreddy.txt".Readline msgbox strCharacters Loop 5) Reading data from a flat file and using in data driven testing .FileSystemObject") If objFSO.FileSystemObject") Set objFile = objFSO.GetFolder(strDirectory) Else Set objFile = objFSO.CreateTextFile("E:\Gcreddy.OpenTextFile("E:\Gcreddy.FileSystemObject") Set objFile = objFSO.

if available delete the File strDirectory="E:\" strFile="gcr.Set s(0) Dialog("Login"). f2 f1="e:\Gcreddy1. True) WriteStuff.txt") txtFilepath.1) myfile."C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\". 8.FileSystemObject") If objFSO.atendofline <> True x=myfile.txt" Public Function CompareFiles (FilePath1.") SystemUtil.txt" f2="e:\Gcreddy2.delete () End if 9) Comparing two text files Dim f1.filesystemobject") Set txtFilepath = objFSO.opentextfile ("F:\Gcreddy.FileSystemObject") Set WriteStuff = myFSO.WinButton("OK").txt" Set objFSO = CreateObject("Scripting. FilePath2) . ".WinEdit("Password:").OpenTextFile("e:\Gcreddy.txt".GetFile("E:\gcr.Close SET WriteStuff = NOTHING SET myFSO = NOTHING 7) Delete a text file Set objFSO=createobject("Scripting."open" Dialog("Login").txt".Activate Dialog("Login").FileExists(strDirectory & strFile) Then Set objFile = objFSO.SetSecure s(1) Dialog("Login").filesystemobject") Set myfile= fso.skipline While myfile.Getfile(strDirectory & strFile) objFile.Click Window("Flight Reservation").Close Wend 6) Writing data to a text file Dim Stuff.myfile Set fso=createobject("scripting."". myFSO. WriteStuff.readline s=split (x.Delete() 8) Checking weather the File is available or not.WinEdit("Agent Name:").Dim fso.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe".WriteLine(Stuff) WriteStuff. dateStamp dateStamp = Date() Stuff = "I am Preparing this script: " &dateStamp Set myFSO = CreateObject("Scripting.

OpenTextFile(sFileName.GetFile(FilePath1).Close() End Function Call Comparefiles(f1. f2) = False Then MsgBox "Files are identical.GetFile(FilePath1). sReadTxt." End If 10) Counting the number of times a word appears in a file sFileName="E:\gcr." Else MsgBox "Files are different.Pattern = sString oRegEx. File2 Set FS = CreateObject("Scripting.Size <> FS.OpenAsTextStream(1. Str2. 0) Set File2 = FS. oRegEx.IgnoreCase = bIgnoreCase oRegEx.GetFile(FilePath2).AtEndOfStream = False Str1 = File1. oMatches Set oFso = CreateObject("Scripting.txt" sString="gcreddy" Const FOR_READING = 1 Dim oFso.OpenAsTextStream(1.Close() File2. oTxtFile.Global = True Set oMatches = oRegEx.GetFile(FilePath2). 0) If CompareFiles <> 0 Then CompareFiles = True Exit Do End If Loop File1.Count Set oTxtFile = Nothing : Set oFso = Nothing : Set oRegEx = Nothing msgbox MatchesFound 11) Read a CSV File Using Database Techniques On Error Resume Next Const adOpenStatic = 3 Const adLockOptimistic = 3 Const adCmdText = &H0001 .FileSystemObject") If FS.Size Then CompareFiles = True Exit Function End If Set File1 = FS. 0) CompareFiles = False Do While File1.Execute(sReadTxt) MatchesFound = oMatches.f2) If CompareFiles(f1. FOR_READING) sReadTxt = oTxtFile.Dim FS.FileSystemObject") Set oTxtFile = oFso.Read Str2 = File2. File1.ReadAll Set oRegEx = New RegExp oRegEx.Read CompareFiles = StrComp(Str1.

adLockOptimistic. ".Open "SELECT * FROM PhoneList.Jet.Recordset") strPathtoTextFile = "C:\Databases\" objConnection." & _ "Data Source=" & strPathtoTextFile & ".MoveNext Loop 12) Read a Text File into an Array Const ForReading = 1 Set objFSO = CreateObject("Scripting.Echo "Extension: " & objRecordset.Fields.HDR=YES." & _ "Extended Properties=""text.Echo "Department: " & _ objRecordset.0.AtEndOfStream strNextLine = objTextFile.") Wscript. adCmdText Do Until objRecordset. File1.FileSystemObject") x= objFso.Fields.Echo "Service: " & arrServiceList(i) Next Loop 13) 'Calculate size of a Text file Dim objFso.txt" Set objFso=CreateObject(" Scripting.Set objConnection = CreateObject("ADODB.GetFile(File1).Item("Extension") objRecordset.csv". Capture Customer names and Export into a Text file 'Test Flow: 'Login Operation 'Open Order Operation and form the Loop to open 1 to 10 Orders .Echo "Name: " & objRecordset.Item("Name") Wscript.File2 File1="C:\Documents and Settings\1 RIGHATWAY\Desktop\xyz.txt".Echo "Server name: " & arrServiceList(0) For i = 1 to Ubound(arrServiceList) Wscript.Readline arrServiceList = Split(strNextLine .EOF Wscript.Item("Department") Wscript. _ objConnection.FileSystemObject") Set objTextFile = objFSO.FMT=Delimited""" objRecordset.4.OpenTextFile _ ("e:\gcreddy.Connection") Set objRecordSet = CreateObject("ADODB.Fields.OLEDB. adOpenStatic.Open "Provider=Microsoft.Size Msgbox x& " Bytes" 14) 'Test Requirement: Open 1 to 10 orders in Flight Reservation . ForReading) Do Until objTextFile.

""."open" Dialog("Login").Set Order_Number Window("Flight Reservation").WinButton("Button"). objFso.Click End If For Order_Number= 1 to 10 step 1 Window("Flight Reservation").").WriteLine "Cusomer Names" myFile.Set "ON" Window("Flight Reservation").WinCheckBox("Order No.Activate Dialog("Login").WinEdit("Edit").CreateTextFile ("C:\Documents and Settings\1 RIGHATWAY\Desktop\abcNew.Dialog("Open Order"). Customer_Name.Set "asdf" Dialog("Login").Click Window("Flight Reservation").exe".WinEdit("Password:").SetSecure "4c48590870466b8dc050bbd24e816890c747ccf8" Dialog("Login").'Capture Cusomer names using GetROProperty Method 'Create File system Object and Open the Text file using the Object and Export Cusomer names '---------------------------------------------------------------------------Option Explicit Dim Order_Number.Dialog("Open Order")."C:\Program Files\HP\QuickTest Professional\samples\flight\app\".WinButton("OK").Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.Activate Window("Flight Reservation").Close Set objFso=Nothing .WinEdit("Name:").GetROProperty("text") wait (2) myFile.WinButton("OK").Click Customer_Name = Window("Flight Reservation"). myFile Set objFso=CreateObject("Scripting.WriteLine Customer_Name Next myFile.Exist(3) Then SystemUtil.FileSystemObject") Set myFile= objFso.Dialog("Open Order").txt".2) myFile.WriteLine "--------------------" If Not Window("Flight Reservation").WinEdit("Agent Name:").

Server=Your_Server_Name.Initial Catalog= Your_Database_Name.Data Source=Your_Server_Name.Data Source=Your_Server_Name.Database connections Database connections Database connection is a facility in computer science that allows client software to communicate with database server software.Password=Your_Password.Database=Your_Database_Name.UserId=Your_Username.Pwd=Your_Password.Initial ." Trusted connection: "Provider=SQLOLEDB.Server=Your_Server_Name.Trusted_Connection =yes." SQL OLE DB connection strings Standard Security: "Provider=SQLOLEDB." Trusted connection: "Driver={SQLServer}. SQL Server connection strings SQL ODBC connection strings Standard Security: "Driver={SQLServer}.Uid=Your_Usernam e.Database=Your_Database_Name. whether on the same machine or not.

UserId=Your_Username. Data Source=c:\App1\Your_Database_Name.0.Uid=Your_Username.Password=Your_Password. Data Source=c:\App1\Your_Database_Name.mdb" Open connection to Access database located on a remote server: "Provider=MS Remote. "Data Source=Your_Server_Name. User Id=admin.OLEDB.Password=Your _Password.Initial Catalog= Your_Database_Name.Jet.4. Jet OLEDB:Database Password=Your_Password" Open connection to Access database located on a network share: "Provider=Microsoft.mdb.Initial Catalog=Your_Database_Name." 2.Trusted_Connection=True.Initial Catalog= Your_Database_Name.UserId=Your_Username.mdb.4. Remote Server=http://Your-Remote-Server-IP.Jet. Data Source=c:\App1\Your_Database_Name.4.OLEDB.0.mdw.NET strings Standard Security: "Provider=SQLOLEDB.0.mdb."Server=Your_Server_Name. Dbq=C:\App1\Your_Database_Name.mdb.Pwd=Y our_Password.Trusted_Connection=False" Trusted connection: 1. Jet OLEDB:System Database=c:\App1\Your_System_Database_Name.Database=Your_Database_Name. DBQ=C:\App1\Your_Database_Name." Trusted connection: "Provider=SQLOLEDB.Jet.mdw" Open connection to password protected Access database: "Provider=Microsoft.Data Source=Your_Server_Name." MS Access OLE DB & OleDbConnection (.Initial Catalog=Your_Database_Name." SQL OleDbConnection . Uid=Your_Username.UserID=Your_Username. Data Source=c:\App1\Your_Database_Name.4.Jet.Database=Your_Database_Name." < br>2.0." MS Access connection strings MS Access ODBC connection strings Standard Security: "Driver= {MicrosoftAccessDriver(*." Exclusive "Driver={Microsoft Access Driver (*.mdb)}. Password=" Open connection to Access database using Workgroup (System database): "Provider=Microsoft.Integrated Security=SSPI.mdb" .0.mdb.4.Password=Your_Password.Jet." Workgroup: "Driver={Microsoft Access Driver (*.Integrated Security=SSPI.mdb)}. Data Source=\\Server_Name\Share_Name\Share_Path\Your_Database_Name.Catalog=Your_Database_Name. Pwd=Your_Password.Integrated Security=SSPI.mdb)}.Data Source=Your_Server_Name.DBQ=C:\App1\Your_Database_Name.NET strings Standard Security: 1.OLEDB.OLEDB.OLEDB.NET framework) connection strings Open connection to Access database: "Provider=Microsoft.mdb. "Server=Your_Server_Name. SystemDB=C:\App1\Your_Database_Name. Exclusive=1." SQL SqlConnection . Remote Provider=Microsoft. "Data Source=Your_Server_Name.

Pwd=Your_Password.world.Oracle. Password=Your_Password. "Provider=MSDAORA.NET framework) connection strings Open connection to MySQL database: "Provider=MySQLProv.51Driver}." Open trusted connection to Oracle database "Provider= OraOLEDB. DRIVER={MySQL ODBC 3.Password=Your_Password. "Provider= OraOLEDB. UID= Your_Username. PASSWORD=Your_Password.Uid=Your_Username.NET framework) connection strings Open connection to Oracle database with standard security: 1.UserId=Your_Username." Oracle OLE DB & OleDbConnection (.Oracle. SERVER= localhost.Your_Oracle_Database.MySQL connection strings MySQL ODBC connection strings Open connection to local MySQL database using MySQL ODBC 3.Data Source=Your_MySQL_Database.DataSource=Your_Oracle_Database." 2." Oracle connection strings Oracle ODBC connection strings Open connection to Oracle database using ODBC "Driver= {Microsoft ODBCforOracle}.Server=Your_Oracle_Server.OSAuthent=1. OPTION=3" MySQL OLE DB & OleDbConnection (.User Id=Your_Username.Password=Your_Password.51 Driver "Provider=MSDASQL.Data Source= Your_Oracle_Database.UserId=Your_Username." . DATABASE=Your_MySQL_Database.

Net for automating QTP operations. Example: . Java script or VC++. together with their properties. that automate our QTP operations. . methods and events. We can use Scripting languages or programming languages such as VBscript. QTP Automation object model provides objects. and their relationships. methods and properties that enable us to control QTP from another application.Automation Object Model AOM Scripting (Automation Object Model) Object Model: An object model is a structural representation of software objects (classes) that comprise the implementation of a system or application. An object model defines a set of classes and interfaces. We can use QTP Automation object Model to write scripts.

Dynamic Handling of Object Repositories Dynamic handling of object Repositories Loading repositories during running. finding path of the repositories and removing repositories is called Dynamic Handling of Object Repositories.visible=True qtApp.quit Note: AOM Script can be used in Automation framework as an Initialization script.close qtApp. To do this.RemoveAll .option explicit Dim qtApp.Launch qtApp.Find(“Path of the Repository”) Syntax for Removing the Repository: RepositoriesCollection.run qtTest.open "C:\Documents and Settings\admin\My Documents\login" Set qtTest=qtApp. Using this feature we can increase QTP performance.Remove(position) Syntax for Removing All Repositories: RepositoriesCollection. Syntax for Loading a Repository: RepositoriesCollection.run qtTest.close qtApp.qtTest Set qtApp=createobject ("Quicktest.Application") qtApp.Add “Path of the Repository File” Syntax for finding Position of the Repository: Variable=RepositoriesCollection. QTP is providing an object called “RepositoriesCollection”.Test qtTest.open "C:\Documents and Settings\admin\My Documents\open order" Set qtTest=qtApp.Test qtTest.

.exe" Dialog("Login"). Script examples.Example: RepPath="C:\Documents and Settings\Administrator\My Documents\Login.WinButton("OK").RemoveAll *********************************** Go to home page for QTP Guide.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.WinEdit("Agent Name:").Find(RepPath) RepositoriesCollection.Remove(pos) RepositoriesCollection.tsr" RepositoriesCollection.Set "mercury" Dialog("Login"). Interview questions and Framework etc.Activate Dialog("Login").Set "sudhakar" Dialog("Login").Click pos=RepositoriesCollection.WinEdit("Password:").Add (RepPath) systemutil.

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.