Quick Test Professional

QuickTest Professional 10.00 Product ID: QTPRPID 10.00/0 Version: Build: 513

I. Basic Features of QTP II. Key Elements of QTP III. QTP Testing Process IV. Generating Tests V. Enhancing Tests VI. Debugging & Running Tests VII. Actions VIII. Functions IX. Regular Expressions X. Environment Variables XI.

I) Basic features of QTP

o QTP Launched in 2002 (Nov). By Mercury Interactive. Later taken over by HP,
in 2007.

o QTP is an Object Based Testing Tool. o QTP is for functional and Regression Testing.
o It follows Keyword driven approach.

o It supports Windows Operating Environment only. o It supports GUI based (Graphical user interface) and Web based Applications
Automation, does not support CUI (Command user interface) Applications. o It has multilingual support. (It supports English, Chinese, Japanese, Korean, etc languages with respect to license.)

o It has adapted Microsoft Visual Basic Scripting edition for programming and
excel like spread sheet for Data driven testing. use SQL statements directly from QTP.

o SQL (Structured query language) embedded or inserted with QTP, so we can o It can be integrated with other Tools like WinRunner and Quality Center. o It 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. o It was derived from Astra QuickTest (mother tool of QTP).

o It supports IE (Internet Explorer) only for recording tests, for execution it
supports other browsers like Mozilla and AOL, opera Etc apart from IE.

o QTP is a Desktop Application (I-Tier/Stand alone). o QTP has two types of License,
1. Seat or Node locked License, 2. Concurrent or float license. Seat license for one system and Concurrent License, we can use for any system but one user at any time. If we want multiple concurrent licenses we can purchase.

o QTP has UNI code support.

Version History of QTP

• •

Astra Quick test (Mother tool of QTP) 1.0 to 5.0 Quick Test Professional 5.6 – Nov 2002 6.5 – 2003 8.0 – 2004 8.2, 8.3 –2005 9.0,9.1-2006 9.2- 2007 mercury interactive 9.5 –2008 H.P 10.00 –2009 January

• • • • • •

Add-In Manager
QTP supports almost all industry leading technologies, but by default it does not support, with respect to add in license it supports. Default Add- ins of QTP are: • • • Activex Visual basic Web.

Other available Add Ins are: .Dot NET, Java, People soft, Siebel, TE (Terminal Emulators), SAP for GUI, Sap for Web, Oracle Apps, Web Services etc. During QTP launching it shows Add in manager dialog box, Add in Manager lists out all available Add Ins in the company. User needs to select appropriate Add Ins for his application or AUT. One can select more than one Add Ins also; if we select unnecessary Add Ins QTP performance will be reduced.

Launching QTP

We can launch QTP BY selecting desktop icon otherwise start > programs> QTP Professional > QTP. During launching it shows Add-In Manager.

Add-in manager window Select appropriate Add Ins and click okay. Quick Test Launches

II) Key Elements of QTP Tool Window

viewing and deleting test scripts. used for creating.QTP Tool Window 1) Test Pane: It is programming interface of QTP. (It is a local concept) . Test: It is a set of statements or set of one or more actions. editing.

Test in Icon based GUI format. Statements may have keywords.Test in VB script format.Action: It is a set of Statements. Expert view. . statement etc). QTP Test Pane-Expert View Key word view. Test pane has 2 views. (It is a local concept) Statement: A minimal executable unit. (Keyword such as function. method. It is a global concept.

it takes snap shots of every statement that user performed action or operation on AUT. Note 2: Technical users use expert view and business user use key word view. Note 3: User can customize Test pane view options. 2) Active Screen It has an optional element of QTP.QTP Test Pane-Keyword View Note1: Here in test pane Test is same but views are different. Navigation: Tools > view options> we can use font size and colors etc. . if you perform any modifications in one view those automatically reflects in another view.

Active Screen .It can be used for understanding and editing the test easily. Navigation: View menu>active screen (for launching and closing) Configuring active screen: view>options>active screen tab>increase /Decrease capture level. apply and okay. Note 1: Generally novice testers use this feature but it occupies lot of memory space on QTP.

etc) and Data bases (MS access. Run time data table. QTP has Data table methods for performing operations on data table.for specific action only. (Available in result window) Run time is a carbon copy of design time data table. Action Sheets. (Attached with every test) 2. Importing data from external files (Flat files.) It has two types of sheets. 2. Navigation: View menu>Data table (for launching and closing) Data driven Testing: Testing the same task(S) or same operation with multiple sets of test data. Data table available in 2 ways: 1. 1. 1. Sql Server. used for Data driven testing.3) Data Table It has an integrated spread sheet (Excel like). Enter test data directly into Data Table and use. . etc. It can be used in two ways. Design time data table. Global Sheet. excel sheets. oracle. 2.for entire test /used for all actions in the test.

QTP Tool window. (debug commands) .Data Table 4) Debug Viewer It is used for locating and rectifying or fixing errors. It can be used for debugging the tests by step-by-step execution. We use step into. step over and step out commands for debugging.

library files etc). Navigation: View menu>debug viewer (for launching and closing) QTP Tool Window-Debug Viewer 5) Missing Resources It can be used for showing missing resources those 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 QTP Tool Window-Information Pane 7) QTP Commands QTP Commands are available in 3 ways. .Navigation: View menu >missing resources (for launching and closing) 6) Information This pane shows syntax errors automatically during saving the test.

active screen. deleting and splitting actions. using this user can generate recordable and nonrecordable scripts. save tests. open existing tests.1. Edit Menu: It provides editing options and renaming. Tool Bar options 3. out put values. Debug viewer. information. Through insert menu user can insert VB Script conditional and loop statements and transaction points (Start and End). export tests in zip format. Insert Menu: Through this menu user can inserting check points. synchronizing points. Short cut keys (for Some important operations only) File menu: Through file menu user can create. View menu: Through this menu we can launch and close. In this menu step generator available. Menu options 2. missing resources etc. . Data Table.

Help Menu: This menu provides QTP help as well as VB Script help. Window Menu: This menu provides QTP tool window style settings. Through this menu we can contact technical support people and we can send feedback. Through this menu we can create /modify/delete objects information and we can associate repositories. modify and delete recovery scenarios. Automation Menu: This menu provides Record. running and also we run tests. . Through this menu we can create. analog recording and Low level recording. Through this menu we can check for updates and download or install directly. In this menu object spy option available. Debug Menu: This menu provides debug commands for step by step execution. through this we can get object’s information. Through this menu we can set tool options as well as test pane view options. (Properties and values) In this menu Virtual object option available. call existing actions and copy existing actions. Tools Menu: This menu provides Tools settings option. Run options and Run setting options Through this menu we can start normal recording. Through this menu we can stop recoding. Resources Menu: This menu provides object repository and recovery scenarios options.Through insert menu user can create new actions. view options and object identification configuration. Through this menu we can insert/remove/break points. through this option we can create virtual objects.

III) QTP Testing Process Planning o o o o o o Analyzing the AUT Automation Test Plan Generation Automation Framework Implementation Generating/Selecting Test cases for Automation Collecting Test Data QTP Tool Settings Configuration Generating Tests o o o Recording Keyword driven methodology Descriptive Programming Enhancing Tests o Inserting Checkpoints o o o o o o Inserting Output values Adding Comments Synchronization Parameterization Inserting Flow Control Statements Calling User defined functions o Generating Steps though Step Generator o Inserting Transaction Points o Regular Expressions Debugging Tests o Debug Commands & Break Points o o o Step by step execution Watching Variables Changing values of variables Running Tests o o o Normal Execution Batch Execution AOM Scripting .

determine the development environments in which our application controls were developed. Then determine the functionality that we want to test. we need to analyze our application and determine our testing needs. try to keep the amount of steps we plan to include in each action to a minimum. . First. follow. Each action should emulate an activity that a customer might perform when using your application. consider the various activities that customers perform in our application to accomplish specific tasks.NET. which will be represented by our test's actions. consider how we can divide these processes into smaller units.o o Tests Running through framework Scheduled Execution Analyzing Results o o o o QTP Result window Defining our own Results Exporting Results Deleting Results Reporting Defects o o o Manual Defect Reporting Tool based Defect Reporting Working with Quality Center Analyzing the AUT Before we begin creating a test. and maintain. To do this. As we plan. Java. or . such as Web. Creating small. so that we can load the required QuickTest addins. Which objects and operations are relevant for the set of business processes that need to be tested? Which operations require customized keywords to provide additional functionality? While we are thinking about the business processes we want to test. modular actions helps make our tests easier to read.

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

3. Record relative to the screen 2. Keep tool under recording mode 2.) 5. 4. It records User actions 7. 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 . Stop Recording 3. Use Low Level Recording for recording in an environment not recognized by QTP. 2. If we select Second option. we have to show the window (AUT). This mode records at the object level and records all run time objects as window or winobject Test objects. Low Level Recording It records some operations on Non-supported environments apart from Normal operations. Navigation: 1.Use Short cut Key (Shift + ALT+F3) Steps for preparing a TEST (through Analog Recording): 1. Record relative to the following window If we select first option QTP records User operations with respect to Desktop coordinates. 1. 6. after showing the Window it records with respect to that window co-ordinates. Select any one option in the dialog box and click Start Analog record. Launch AUT (or we can launch AUT through QTP) Select Record option Automation>Analog Recording Analog Recording Settings Dialog box opens (In this Dialog box two options available.

2. 2. . Software objects: We call windows. buttons. SystemUtil for launching/closing the application. Object: Object is something. 4. 1. Link. Types of Object in QTP: There are four types of object available in QTP. Ex: WinEdit. links. WebPages. 3. Run time objects Test objects Utility objects Automation objects/User defined objects. Ex: Run time objects Test objects in Test objects in VB windows Environment Environment buttons WinButton VBButton Edit box WinEdit VBEdit Check box Wincheckbox Vbcheckbox Test objects in web Environment WebButton WebEdit Webcheckbox Utility objects They are QTP reserved objects used for testing and result reporting. as software objects. check boxes etc.Object Repository Object Repository: It is a storage place of QTP where we can store the objects information and it also acts as interface between the test script and the AUT in order to identify the objects during execution. Ex: 1. edit boxes. which has structure and properties. etc… Note: Test objects names vary from one environment to another.. etc… Test Objects: References of Run time objects. WinButton. Reporter for defining results. Ex: Buttons. WebButton. Run time objects: The objects present in the AUT.

3. Navigation: Resource menu>object repository (Short cut key Ctrl+R) . dictionary object class. That cannot be shared among tests. Environment for using environment variables Automation objects/User defined objects User can create objects. User can add some more objects to Local repository User can perform rename. Services for inserting transaction points 4.connection class. Application class etc. 1. those can be used for performing specific operations. As it is QTP internal file user no need to save modifications. Local repository (. There are two types of repository available in QTP. Shared repository(. adodb. delete operations in local repository.MTR extension) 2. excel.TSR extension) Local Repository: QTP creates a Local Repository for every action automatically during Recording. Ex: Creating objects in file system object class.

QTP. 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. That can be shared among number of tests. Shared Repository: Navigation: Resource menu>object repository manager>object>Add objects>show the window/object>click ok . Using this method user can perform modifications on objects easily. it saves automatically) B. Operations on Object Repository Adding objects a.Local Repository Shared Repository: User (Test Engineer) creates shared repository by adding objects.

>close repository b. . 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. we can select more than one class also. if we select third option it stores All objects including static objects.) Renaming 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: 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. Deleting objects a. if we select fourth option. >close repository b. Note: After merging also.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. Local Repository: Resources > object repository >select object and right click >choose rename option >modify the name>release the mouse. Associating objects repositories to an action 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. if we do not want source files we can delete. source repository files will be available. Local Repository: Resources > object repository >select object and right click >choose delete option >confirm deletion>.

(1. Highlight in Application This feature can be used for identifying objects from repository to application. (Test objects names. Navigation: File>import from XML >browse path of the XML file >it loads objects. Navigation: File >export Test objects to XML Enter the file name and Save with xml extension. In tools Menu 2.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. property & Values) QTP is providing a feature called Object Spy. it can be available in 3 Areas. Exporting Repository to an XML file We can export our repository file to an xml file. Note: The purpose of this feature is Editing objects information outside of the QTP . We can import XML file to our repository. In local repository 3. 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. using this we can get objects information. Navigation: Select object in the repository >view>highlight in application>it highlights specified objects in the application. Importing Repository from XML file. Spying objects For getting objects information. Navigation>Tools>object spy>take hand icon & Show the object>get information (Object Spy shows the specific objects all available properties with their values) Note: As Object spy is an important feature.

Set Ex: Window("Flight Reservation").select “item” Ex: .WinRadioButton("Business"). Dialog("Open Order").Set “ON/off” Ex: Window ("Flight Reservation").Close DBL CLICK: It Double clicks the object.WinEdit(“Agent Name”).Winbutton(“ok”). Click Ex: Dialog(“Login”). Close Ex: Window(“Flight Reservation”). Syntax: Object hierarchy.WinCheckBox("Order No. a. Syntax: Object hierarchy.Activate Window(“Flight Reservation”).Methods Activate: It activates dialog boxes/Windows Syntax: Object hierarchy.Close Browser(“Browser”). Set Method: It can be used in three ways. Activate Ex: Dialog(“Login”). Selecting/Deselecting check boxes Syntax:object Hierarchy.Set "ON" Select Method: It is used for selecting an item from a combo box or list box.Activate Click Method: It clicks on an object (Buttons) Syntax: Object hierarchy.Dialog box. Browser window etc.Set c. For setting the value of an edit box Syntax: Object Hierarchy.click Close Method: It closes the window. Selecting a Radio Button Syntax: Object Hierarchy.Set “asdf” b. SET “Value” Ex: Dialog (“Login”).").

Syntax: Variable=object hierarchy.Exist(5) .WinComboBox("Fly From:").navigate “URL” Ex: Browser("Yahoo!").google.WinList("From").WinComboBox("Fly From:").exist(time in seconds) Ex: Window("Flight Reservation").GetROProperty ("width") msgbox x Navigate Method: It opens a specified URL in the Browser.Navigate "http://www. Syntax: Object hierarchy. any property value. Syntax: object hierarchy.Select "London" B.GetContent msgbox x Exist property: It checks whether the object is available or not.GetItemsCount msgbox x Getcontent: It returns all items from a combobox.WinComboBox("Fly From:").getitemscount Ex: x=Window("Flight Reservation").GetVisibleText msgbox x GetRoproperty: It returns current object property value.WinComboBox("Fly From:"). Syntax: Variable =object hierarchy.co.getroproperty (“property name”) Ex: x=Window("Flight Reservation").in" Getitemscount: It returns number of items in a combobox.GetContent Ex: x=Window("Flight Reservation").A. Syntax: Variable = object hierarchy. It can be used for getting any object’s.getvisibletext Ex: x=Window("Flight Reservation").WinEdit("Tickets:").Select "12572 GetVisibletext: It returns Text from the specified area. Window("Flight Reservation"). Window("Flight Reservation"). Syntax: variable=object hierarchy.Dialog("Flights Table").

Set "mercury" dialog("text:=Login").Winedit("attached text:=Agent Name:"). Setsecure.exe" dialog("text:=Login")."width:=60").Create . first we create description objects.Create oOk=description. we can use object spy feature. Note3: If we want to get objects information (Test objects. Login. Password:. Set. Agent Name:. Dialog.Activate dialog("text:=Login").Descriptive Programming/Programming Descriptions Providing objects information directly into the test script is called Descriptive Programming. Dynamic Programming Static Programming: In this style of script generation.Create oAgent=description. properties and values).Property values or Logical Names of the Object 4. attached text . then we can provide more properties information by separating with commas.Methods Note2: If we feel one property information is not sufficient for recognizing the object uniquely. Dynamic Programming: In this style of script generation. Creating Properties Collection Objects Set Set Set Set oLogin=description.Create oPassword=description. Activate.Set "asdf" dialog("text:=Login"). Descriptive programming is basically 2 types.Property names 3. OK .Winbutton("text:=OK". text. These scripts can be executed faster than repository based scripts. This feature is available in Tools Menu. Ex: Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.Click Note1: 1.Winedit("attached text:=Password:"). 1. in local repository and in repository manager. Click . we provide objects information directly into the script. WinEdit and WinButton – Test Objects 2. provide properties information and use description objects in the test script. Static Programming 2.

Winedit(oPassword). by associating that library file. Adding Comments 4.exe" Dialog(oLogin). Note2: Dynamic programming is some difficult in preparation than static programming but maintenance is very easy.Winbutton(oOK). Inserting Transaction Points:(Start and End) Inserting Check Points: Check point is a verification point.Winedit(oAgent).value="Password:" oOk("text"). we can generate tests.Activate Dialog(oLogin).Set "mercury" Dialog(oLogin). There are several methods available in QTP for enhancing the TEST. Enhancing Tests After generating the basic test.Entering Properties Information into Objects oLogin("text"). we have to enhance the test in order to Test the AUT with respect to requirements.Click Note1: Create Description objects and put into one library file. Generating Steps through Step Generator 8. There are 11 check points available in QTP: 1. Inserting Output Values 3.value=320 oLogin("height"). Inserting Flow Control Statements 5. Parameterization 7.value=204 oAgent("attached text"). Standard check point .value="Agent Name:" oPassword("attached text"). Inserting Check Points 2. it takes expected result from the user and compares with actual results during execution and provides test results. Synchronization 6. 1.value="Login" oLogin("width").Set "asdf" Dialog(oLogin).value="OK" Generating Tests using Properties collection Objects Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.

6. 5. 9. Text Checkpoint: It checks object’s text property value in different ways. Navigation 2 (editing standard checkpoint) Select checkpoint statement and right click >choose checkpoint properties option>modify the value>click ok. 4. 2. 10. Navigation1(Inserting standard checkpoint) : Keep tool under recording mode>place cursor in desired location>Insert > check point>Standard checkpoint>Show the object (which is result window)>click okay>select property and enter expected results & click ok and stop recording. Note 2: From 9 to 11 checkpoints are hidden checkpoints. Through expert view. We can use this checkpoint for checking any property value. 3. 8. Through keyword view.) . exact match. Note: We can insert standard checkpoints in 3 ways. we can insert these checkpoints through standard checkpoint. 11. Through Active screen. Navigation: keep tool under recording mode>Insert check point>text checkpoint>Show the object >click ok>Select options (Match case. 7. 2. 3. 1. Navigation 3 (Deleting standard checkpoint) Select checkpoint statements and right click>choose delete option.2. 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. text not displayed. 1. Standard Checkpoint: It checks object property values. ignore spaces. 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 Image checkpoint Table checkpoint Note 1: From 6 to 11 checkpoints are only for Web.

we can customize. 5. Navigation: Keep tool under recording mode>insert >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. according to our requirements. text not displayed. exact match. 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. Navigation: Keep tool under recoring mode in web environment>insert >checkpoint (from application)>show the xml pages>click ok>stop recording. 2. Note: here we do not need to put on recording mode and we do need AUT since data is from backend. Configuring accessibility checkpoint: Tools>options>web>advanced>check/uncheck items >click apply>click ok Navigation: Keep tool under recording mode with web environment >insert>checkpoint>accessibility checkpoint>show the webpage>click ok>click ok>stop recording. according to W3C rules then Pass. 1. If an item is not available then result would be pass 7. If an item is available. XML Check point (from resource) . 9. we can compare complete bit maps as well as part of the bit maps. Bitmap checkpoint: It compares bit maps.) Click ok and stop recording. Text Area Checkpoint: It checks the text area present in the application.We can select one or more options>click ok & stop recording. 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.XML Check point (from application) It checks content of the XML file. 6. If item is available but not according to W3C rules then fail. Navigation: Keep tool under recording mode >Insert arrow checkpoint>Text area checkpoint>Mark the area of text >select one or more options (Match case. 3. Database checkpoint: It checks Content of the back end database. ignore spaces. It is a configurable checkpoint. 4. Result Criteria: 1.

Note: 2. Navigation: Keep tool under recording mode under web environment>insert>checkpoint>standard checkpoint>show the table>click ok >stop recording. images available in a web page. we can insert this through standard checkpoint. It is stored in run time data table. Navigation: keep recording mode with web environment >insert>checkpoint>standard checkpoint>show the image>select image>click ok>click ok>stop recording. 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. Page checkpoint: It checks number of links. Image checkpoint: It checks Image property values. 3. Navigation: Insert>checkpoint>xml checkpoint (from resource)>browse path of the XML File >click ok>click ok.It checks content of the XML file. 5. 2. 6. 12. Table checkpoint: It checks content of the web tables. 4. It is a hidden checkpoint. Note: 1. Inserting Output Values: It is a step in which one or more values are captured during execution. Navigation: Keep tool under recording mode with web environment >insert>checkpoint>Standard checkpoint>show the page>click ok>click ok>stop recording. it is located in QTP result window and can be retrieved later. 10. then we can go for inserting xml checkpoint from resource. 11. Types of Output Values: 1. If XML file is part of web application. separate path is not available then we can choose inserting XML checkpoints from application. If XML file is an individual and path available. Standard output value Text output value Text area output value Database output value XML output value (From Application) XML output value (From Resource) .

Navigation: Keep tool under recording mode>Insert>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.. F.A. Database output value: We can use Database output values to output the value of the contents of database cells.>check in runtime table after running it. C. Text output value: We can use Text output values to output text strings displayed in an application. B. Use Apostrophe (‘) before the statement . Navigation: Keep tool under recording mode >Insert >output value>standard output value>show the object>click ok>select property>modify the column name (if required)>click ok>click ok>stop recording. 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. XML output value(from application): we can use XML output values to output the values of XML elements in XML documents. Adding Comments: Purpose of Comments: o For making the script understandable o For making the Script Disable from execution Syntax: 1. Navigation: Keep tool under recording mode with web environment>Insert>output value>XML output value from application>Show the XML document>select elements>click ok>stop recording. Navigation: keep tool under recording mode>insert>outputvalue>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. Navigation: Insert>outputvalue>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 datacells>click ok>Run and it will capture and see the results in run time table. D. Navigation: Insert>output value>XML output value from resource>browse path of the XML file >click ok>select elements>click ok. Standard output value: We can use standard output values to output the properties values of most objects. XML output Value (From Resource) we can use XML output values to output the values of XML elements in XML documents. Text Area output value: We can use text area output values to output text strings displayed within a defined area of the screen. E.

There are several methods available in QTP for synchronization. Inserting Synchronization point: . Use shortcut key ctrl+shift+M Inserting Flow Control Statements: QTP adapted Vbscript engine for applying programming logic to tests.2. Inserting Wait statements. Where Synchronization is required: During test execution QTP gives instructions one by one with same speed. Synchronization It is a process of matching the speeds of both QTP and AUT in order to get proper execution and results. Increasing Tool default synchronization time. In order to get proper results in between QTP & AUT synchronization is required. 2. 3. We can insert Vbscript conditional statements and loop statements for applying the logic. 1. 4. Sync Method (Only for WEB) Inserting Wait Statements: We can insert wait statements in our test in order to make QTP to wait until AUT completes current operation. Inserting Synchronization points. Use REM Command with single space before the statement Comment a Block of Statements: Navigation: Select block of statements >edit menu>advanced>comment block Or After selecting block of statements use shortcut key Ctrl+M Uncomment a block of statements: Navigation: Select comment block>Edit menu> Advanced>Uncomment block Or After selecting comment block. but AUT takes less time for some operations execution and more time for some operations execution. that time we may not get proper execution and results. In Vbscript there are 2 types of conditional statements and four types of loop statements available. Syntax: Wait(time in seconds) Note: If we insert wait statements QTP waits up to maximum time even though operation is completed.

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. but QTP does not wait up to maximum time unnecessarily. Above two are local features but wait statement is Vbscript feature. Suppose in our test more statements are taking more time for execution then selecting “increasing tool time out” .StartTransaction "name of transaction" ------statements ---------------services.Sync Selecting an appropriate Method: 1. Syntax: Object Hirearchy. Syntax: object hierarchy. . Syntax: Services. Note: if we insert Synchronization points. Inserting Transaction Points:(Start and End) We can insert Transaction points for measuring Transaction time. After completion of one statement execution it goes to next statement immediately. after completion of the current operations. Sync Method: (only for WEB) Waits for the browser to complete current navigation.Sync Ex: Browser("Yahoo! Toolbar"). It is a performance concept but QTP supports measuring transaction time per user only. even though some drawbacks are there in using wait statement. it is better to use wait statement in functions. it goes to next step immediately. 2. 3.Page("Yahoo! Toolbar").value.EndTransaction "name of the transaction" Note: We can insert multiple transactions points in a test.waitproperty “property name”.time in milli seconds. 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. it does not wait up to maximum time. Suppose in our test one or more statements only are taking more time for execution then selecting “Inserting synchronization method” is better.

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

It has 3 types of usage .exe" Dialog("Login"). c. Entering test data directly into data table and use Importing test data from external Flat files Importing test data from external Spread sheets Importing test data from Data bases.WinEdit("Agent Name:").) Run the test.SetSecure pwd Dialog("Login").Type micTab Dialog("Login").1) invokeapplication "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a. Entering test data directly into data table and use. but first we have to create /get the DSN(Data source Name)& we have to use SQL Commands. Agent = Datatable("Agent". 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”. 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. A.Close b.Set Agent Dialog("Login"). a.WinEdit("Password:"). Sheet id) Example: agent=datatable(“agent”. Importing test data from Data bases: Through Data table we can import Test Data from Data bases.1) Pass parameters. D.1) pwd=Datatable ("Password". c. .WinEdit("Agent Name:").WinButton("OK").Click Window("Flight Reservation").Activate Dialog("Login"). d. b. 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>Browse path of the file(it imports data from the flat file) Connecting Test Data to QTP Test as above and run the test.

Fetching Test Data directly from Flat files Dim fso. Creating a Test Database: open MS Access (or we can use any other database).1.rs Set con=createobject("adodb.WinEdit("Agent Name:")."open" Dialog("Login").Close Wend Fetching Test Data directly from Excel Sheets Fetching Test Data directly from Databases option explicit Dim con.Set s(0) Dialog("Login"). by using the DSN we can get data for number of tests.skipline While myfile. Entering Data into Tables: Select table>enter the data.opentextfile("d:\trigun.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.Type micTab Dialog("Login").Activate Dialog("Login").connection") .atendofline <> true x=myfile.1) myfile.WinEdit("Password:").SetSecure S(1) Dialog("Login").readline S=split(x.filesystemobject") Set myfile=fso. 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. 4. myfile Set fso=createobject("scripting.WinEdit("Password:").exe".WinEdit("Agent Name:").Type micReturn Window("Flight Reservation"). Start programs>MS Office>MS Access>file >new>Select blank Database>enter name of the database>Save with mdb extension.txt"."@") SystemUtil. 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."". Note: DSN Creation is one time activity."C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\".

oledb.Close rs.eof=true SystemUtil. It executes all functions statements at a time Note: After opening the function. Step Over (Short cut key F10) e.provider=("microsoft. Ex: Dim a. QTP is providing debug commands and breakpoints.con do until rs."C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\".4.WinEdit("Agent Name:"). It executes one statement at a time after execution starts f.Set rs=createobject("adodb. Step Into: (short cut key F11) a.open "select * from login".WinEdit("Password:"). it opens the function.b.SetSecure rs.Activate Dialog("Login").movenext loop Debugging the TEST 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.fields("password") Dialog("Login"). c.c a=100 b=200 c=a+b msgbox c msgbox "hello" .Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a. 2.open "C:\Documents and Settings\pooja\My Documents\trigun.Type micReturn Window("Flight Reservation"). Step Out (shift +F11) It executes all remaining statements in a function at a time."open" Dialog("Login"). Debug Commands: 1. after that it executes one statement at a time.mdb" rs. It executes one statement at a time.recordset") con.exe".Type micTab Dialog("Login").fields ("agent") Dialog("Login"). if we use step over it executes one statement at a time only. It starts execution b.WinEdit("Password:").Set rs."".jet. For debugging. 3. If it is function call.0") con.WinEdit("Agent Name:").

We can watch variables whether the variables are taking correct values or not at a specific point of time. 1. Variables 3. modifying or setting the value of the variables during the execution break with the help of 3 Tabs. 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. Ex : Dim x. . Command Note: Through Debug Viewer Pane.Call hyderabad msgbox "bye bye" Note: Create a script and work on it Break Point: This feature is used for breaking the execution temporarily. We can change Values of Variables temporarily. Debug viewer Pane: It is used for viewing.y.z x=10 y=20 z=x+y msgbox z msgbox "Hello" x=35 y=67 z=x*y msgbox z msgbox "bye bye" Navigation: debug viewer>Use step into feature. Navigation: Place cursor in desired location >Debug menu>Insert/Remove break point Or Use short cut key (F9) Or Place mouse pointer before the statement and click. Watch 2. there we can use breakpoints.

Steps for batch testing: 1. 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. 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.Running the Test / Executing the Test 1. We have to view Test wise results through Test Result viewer. 3. QTP runs Tests one by one. methods and properties that enable us to control QTP from another application. Note: QTP does not provide Batch wise test results. Batch execution/Batch Testing Executing a group of tests at a time is known as batch execution. Java script or VC++. . 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. 3. 2.Net for automating QTP operations. Open Test batch runner tool and form batches. Execute Test batches from Test batch runner. For performing batch execution QTP is providing a separate tool called test batch runner. Forming a Test Batch: Launch Test batch runner. Note: Allowing other products to run tests. QTP automation object model provides objects. Normal execution/ General execution (Executing one test at a time) 2. . We can use Scripting languages or programming languages such as VBscript. AOM Scripting (Automation Object Model) We can use QTP automation object Model to write scripts that automate our QTP operations. Prepare individual tests and run once.

visible=True qtApp. Result Reporting: From QTP result window. qtApp is variable. Or Click result icon on Automation tool bar> B. “quicktest. 6. Createobject is for function. Navigation: Start programs>quick test professional>Tools>Test result Deletion tool>browse path of the test>Select result>click Delete>click close.Test qtTest.run qtTest.open "C:\Documents and Settings\admin\My Documents\open order" Set qtTest=qtApp.Vbs>select the schedule>click next>enter time and date>click next>enter system name and password if required>click next>click Finish. Test result viewer: QTP is providing Test Result Viewer for viewing and exporting test results.application") qtApp.run qtTest.close qtApp. . Navigation: Start>Programs>Quick Test Professional>Test Result Viewer>File >open>Browse path of the test>Select Result>click open.quit Notes: Set is for statement. C.open "C:\Documents and Settings\admin\My Documents\login" Set qtTest=qtApp.Test qtTest.close qtApp. Executing Tests through Framework 5.qtTest Set qtApp=createobject ("quicktest.application” is used for class value Launch is used for method.Launch qtApp.Ex: option explicit Dim qtApp. Scheduled execution Navigation: Start>Settings >control panel>Select on scheduled tasks>Click add scheduled task>click next>Select Application as quick test professional>Click next>Type name of the task AOM. Analyzing the results: a. Or From QTP Tool window: Automation menu>results>browse path of the test> Select Result>click open. Deleting Test Results: For Deleting test results QTP is providing a separate Tool called Test Result Deletion Tool. 4.

Note: In QTP 10. XML & PDF formats also available. open company prescribed defect report template.Navigation: File >export to HTML file>click export>browse path of the location>save. Apart from HTML format DOC. We can send defects directly from QTP result window. enter defect details and send After analyzing the results. open the defect reporting template. QTP Any Tool like BugZilla or issue –Tracker or PR – Tracker. Reporting Defects Functional Automation QTP Defect Management Manual Tasks After analyzing the results. Purpose of Actions: For understandability For reusing components Types of Actions: Non Re usable actions Re usable actions External actions Operations on actions: • • • Creating Actions Splitting Actions Renaming Actions . QC (Quality Center) QTP Actions Other QTP Features We divide our test into actions to streamline the process of testing. open the TOOL. enter defect results and send In between QTP & QC back to back integration.0. etc.

D. Deleting Actions: Select desired action in action drop down box>edit menu>action>delete action>confirm deletion.• • • • 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. Making an action reusable: Select Non Reusable action >edit >action>action properties>check reusable action check box >click ok. G. E. insert. C. Split into meaningful actions. Prepare Scripts for those actions. Copying an action: Insert>call to copy of action>browse path of the test>select desired action>click ok.delte) 2. Regular Expressions . Create required actions(ex login. Splitting an action: Navigation: Place cursor in desired location>Edit menu>action>split action>Enter Action 1 name & action 2 name. Note: At a time we can split one actions into 2 actions. Renaming actions: Select desired action in action drop down box> edit menu>action>rename action>modify the name>click ok. Steps: 1. Generate total test in the default action 2. Calling an action: Insert>call to existing action>browse path of the test>select desired action>click ok. Note: we can edit this action. B. Note: U can’t edit F.

Always-regular expression we use brackets.Winedit("attached text:=Password:"). Syntax: SUB Statements End Sub Note: Arguments are optional . We can give number of arguments by separating with commas. we use these for reusing components. 1.c) Creating a Sub procedure Open an editor (notepad) Prepare test script Save as Dot. Navigation: Open object repository >select the object>select the property value>click configure>check regular expression >enter expression [0-9] close repository.Set "asdf" dialog("text:=Login"). Ex: (a. 2. Function procedures A.Set "mercury" Name of the procedure(arguments) . Vbscript Procedures: In Vbscript there are 2 kinds of procedures available.vbs file Ex: Sub login Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a. Sub procedures 2. [A-Z] 3. For example use fax order Functions: Functions are Vbscript features. [A-Z] [a-z] we can also use two expressions together [0-9] for one to 9 digits this is how we use [0-9]*for 2 digit numbers to be considered.Winedit("attached text:=Agent Name:").Activate dialog("text:=Login"). [a-z] 4. Note: 1. Sub Procedures: Sub procedure performs a task(s) but cannot return a value.exe" dialog("text:=Login").b.We use regular expressions whenever object’s properties values are changing dynamically.

vbs” Calling a procedure: Call procedure name (ex Call login) Function Procedure (it returns a value) Function trigun(a. Built in variables: These are system defined variables.300) msgbox x Environment Variables These are global variables.200.dialog("text:=Login"). 2. If we declare as local variables in number of tests.c) res=(a+b+c) trigun=res End Function x=trigun(100. if you want to use some variables globally (From number of tests) declaring as global variables is better.Click End Sub Associating a procedure to QTP.b."width:=60"). Usage of environment variables: Syntax: Variable = Environment(“environment variable name”) Ex: X=Environment (“ActionName”) Msgbox x Example Script: . we can access from all tests but these are designed as read only.Winbutton("text:=OK". Types of Environment variables: 1. Navigation: File >settings>Resources>Click add icon>browse path of the library file>click apply>click ok Or Executefile “path of the library file” C:\Documents and Settings\pooja\Desktop/login. We can create as many files as we want and we can change values of variables. User defined variables: Variables that we predefine in the active external environment variables file. modifications are difficult.

Activate Dialog("Login"). Virtual object configuration It is a process of making the QTP to treat a specified area or an user defined object as a specific object. Or We can load environment file directly Environment.exe" Systemutil. 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.SetSecure "4b3c86f2107ff565cc195ba6c24739091b656407" Dialog("Login"). .ProductDir =environment ("ProductDir") app= "\samples\flight\app\flight4a.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. Navigation: Tools>virtual objects>virtual object manager>click new>click next>select class(ex button)>click next>click mark object>mark the area on AUT>click next>click next>enter collection name or project name>click finish>click close.Run ProductDir & app Dialog("Login"). save with xml extension.Set "kajal" Dialog("Login").WinEdit("Agent Name:").Click Creating user defined environment variables: Navigation: 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.>click ok.WinEdit("Password:").WinButton("OK").

5. Open Test batch runner tool and form batches.tsr" RepPath2= "C:\Documents and Settings\admin\My Documents\Orders. Note: Allowing other products to run tests. 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. Batch Testing or Batch execution Executing a group of tests at a time is known as batch execution. 6. Steps for Batch Testing: 4. Dynamic Handling of Object Repositories We can handle the object repositories through scripting with the help of a utility object Repositoriescollection Ex RepPath1= "C:\Documents and Settings\admin\My Documents\Login. 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. Forming a Test Batch: Launch Test Batch Runner.tsr" Repositoriescollection.Add (RepPath1) . Prepare individual tests and run once. For performing batch execution QTP is providing a separate tool called test batch runner. QTP runs Tests one by one.Note: when you run and click on virtual object you will see as virtual button. Running/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. Execute Test batches from Test batch runner.

20" Window("Flight Reservation").Close Repositoriescollection.Click Note 1: For loading repository file (Reposotoirescollection. Repositoriescollection.WinList("From").Add (RepPath2) Window("Flight Reservation").WinButton("Insert Order").Dialog("Flights Table").WinButton("New").Find(RepPath1) Repositoriescollection.Dialog("Flights Table").Activate Window("Flight Reservation").exe" Dialog("Login").WinComboBox("Fly To:").Add (RepPath1) SystemUtil.Select "20289 09:12 AM DEN 04:23 PM AA $112.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.find (“Path of the repository file”) Note 3: For removing a specific repository file.Add “path of the Repository file”) Or Vairable =”path of the repository file” Reposotoriescollection.Activate Dialog("Login").Click Pos=Repositoriescollection.Click Window("Flight Reservation").Set "gcr" Window("Flight Reservation").Type "101010" Window("Flight Reservation").WinComboBox("Fly From:").Click Window("Flight Reservation").Select "Denver" Window("Flight Reservation").Set "mercury" Dialog("Login").WinEdit("Name:").SystemUtil.Activate Window("Flight Reservation").Activate Window("Flight Reservation").Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.Click Window("Flight Reservation").add (variable) Note 2: For finding repository position Variable =reposotoirescollection.exe" Dialog("Login").ActiveX("MaskEdBox").WinEdit("Agent Name:").Set "mercury" Dialog("Login").WinButton("FLIGHT").Dialog("Flights Table").WinButton("OK").WinButton("OK").Activate Dialog("Login").Set "asdf" Dialog("Login").WinEdit("Password:").Select "London" Window("Flight Reservation").WinEdit("Password:").remove (position) Note 4: For removing all loaded repositories Repositoriescollection.Dialog("Flights Table").WinEdit("Agent Name:").WinButton("OK").Set "asdf" Dialog("Login").removeall LON .Click Window("Flight Reservation").Remove(Pos) Repositoriescollection.RemoveAll Repositoriescollection.

Creating the required Creating the required corresponding folder. 3. Linear framework or Record/Playback framework. 2. Automation framework: It is a systematic approach developed by experts for automating any application. 4. shared repository files & storing them in the library files and storing them in the corresponding folder.Automation Framework Framework: It is a generic work (outline work) or a set of guidelines designed by experts to perform a task(s) in an effective. environment variable files and storing them in the . efficient and optimized way. Keyword driven framework: • • • • Creating the required Creating the required corresponding folder. Modular framework Keyword driven framework Hybrid framework Linear framework: • • • • • • Generating the basic test using recording feature Enhancing the test using Tool features Debugging the test if required Running the test Analyzing results Sending defects Modular framework: • • • • • Generating the individual components for each and every task (Actions) Making them as reusable components Preparing the required driver scripts Executing the Drivers Analyzing the results. Test Case file & storing it in the corresponding folder. Types of Framework: 1.

Driver script It executes all tests one by one. Editing a Recovery Scenario: . Problems problems Problems problems related related related related to to to to path of the windows object state Test execution application crash To define a solution for the above problems QTP has provided 4 trigger events. Recovery Scenarios During the execution QTP may face some problematic situations where in it needs to recover by itself and continue the execution. If we want to execute our desired tests. 2. 4. 1. To do the same the Test Engineer would have defined a solution well in advance and made it available to current test before starting the execution. 2. In driver script we call required functions. QTP may face 4 types of problematic situations: 1.Note: In this framework we create required tests and make them as functions. Initialization Script It launches QTP Tool and calls Driver Script 2. In this framework we have 2 scripts only. 3. 3. 4. Popup window Object State Test runner error Application Crash Creating a Recovery Scenario: Navigation: Resources menu>Recovery Scenario manager>click new scenario icon>Click Next>Select Trigger event(Test run error) >Click next>Select error type (item in list or menu not found)>click next>click next>select recovery operation(Function Call)>click next>browse path of function library(notepad)>click next >check another recovery operation if required>click next>select post recovery operation(proceed to next step)>click next>enter scenario name>click next>Check add scenario to current test if required>click finish>click save>click close. 1. then we need to modify the Driver script only.

Click Window("Flight Reservation").AddSheet "gcr" datatable.GetRowCount For i= 1 to n datatable.Close Next Example 2): datatable.exe" Dialog("Login").ImportSheet "C:\Documents and Settings\Administrator\Desktop\gcreddy.xls".3) VbWindow("Form1").1.GetROProperty ("text") If eres=ares Then datatable("res".Navigation: Resources menu>Recovery Scenario manager>click open>browse path of scenario file>Select scenario>click edit icon>click next(through navigating modify required values)>click finish>click save>click close.VbButton("ADD").1.3)=fail .3)=pass else datatable("res".GetSheet (3).SetCurrentRow(i) Invokeapplication "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.Set datatable("V1".3 n=datatable.VbEdit("val2").Value ("res".WinButton("OK").Set datatable("pwd".Activate VbWindow("Form1"). Addsheet method Data Table Methods Adds the specified sheet to the run-time Data Table and returns the sheet Syntax: Datatable.Click eres= Datatable.3) Dialog("Login").GetSheet (3).Activate Dialog("Login").WinEdit("Password:").Addsheet “sheet name” DeleteSheet method Example1): datatable.Set datatable("agent".ImportSheet "C:\Documents and Settings\Administrator\Desktop\gcreddy.3) Dialog("Login").3) ares=VbWindow("Form1").3) VbWindow("Form1").VbEdit("val1").3 n=datatable.xls".GetRowCount For i= 1 to n Datatable.WinEdit("Agent Name:").Set datatable("V2".AddSheet "gcr" datatable.SetCurrentRow(i) VbWindow("Form1").VbEdit("res").

End If Next .

Sign up to vote on this title
UsefulNot useful