QTP Material | Databases | Visual Basic For Applications

Software Testing Automation (QTP) ________________________________________________________________________

Quick Test Professional

-1-

Arcus Infotech (P) Ltd

Software Testing Automation (QTP) ________________________________________________________________________

This book is dedicated to

Lord Vignesh

-2-

Arcus Infotech (P) Ltd

Software Testing Automation (QTP) ________________________________________________________________________ TABLE CONTENTS 1. Introduction to QTP: …………………………………………………..9 1.1. What is Quick Test Professional?: ……………………….9 1.2. How to decide what test case to be Automated?: …9 1.3. How does QTP works?: ………………………………………10 2. Testing Process: ………………………………………………………….10 2.1. Planning: …………………………………………………………11 2.2. Creating Tests or Components: …………………………..11 a. Either Recording a session on your application or Site: .………………………………….11 b. Object Repositories: ……………………………………..11 2.3. Inserting Checkpoints into your test or Components: ……………………………………………………12 2.4. Debugging test Script: ……………………………………….12 2.5. Running the Test Script: …………………………………….13 2.6. Analyzing the Result: …………………………………………14 2.7. Reporting Defects: …………………………………………….14 3. What is VB Script: ……………………………………………………….14 4. Quick Test Professional Window: ………………………………….15 4.1. Title Bar: ………………………………………………………….15 4.2. Menu Bar: ………………………………………………………..15 4.3. File Toolbar: ……………………………………………………..16 4.4. Testing Toolbar: ……………………………………………….16 4.5. Debug Toolbar: …………………………………………………16 -3Arcus Infotech (P) Ltd

22 6.24 B. Verify Mode: …………………………………………24 b. Debug Mode: ………………………………………. Add-in Manager: ………………………………………………………….18 4.17 4..24 c. Analog Recording: ……………………………………….24 A..12.1.7. What are the Modes of Recording: ………………………22 a.1.20 5. Snap Shot of Error Message: …………………………………………25 7. Recording QTP Scripts: ……………………………………………….. Keyword view: …………………………………………………. Defined Time Data Table: ………………………………19 b. Syntax error: ……………………………………………………25 7. Active screen: …………………………………………………18 4.Software Testing Automation (QTP) ________________________________________________________________________ 4.8. Low Level Recording: ……………………………………23 6.. Object not Found in the Repository: ……………………26 -4- Arcus Infotech (P) Ltd .6.10.11. Expert view: ……………………………………………………. Sequence of Things happening when the Script is Played Back: ……………………………………………………25 7. Run Time Data Table: ……………………………………20 4.16 4.2. General Recording: ………………………………………22 b.2.. Play Back of QTP Script: ……………………………………. Test Pane: ………………………………………………………. Debug Viewer Pane: ……………………………………….23 c.18 4.21 6.. Datatable: ………………………………………………………19 a. Modes of Running Test: ………………………………. Action: …………………………………………………………….24 a. Update Mode: ……………………………………….9.

27 8.41 a.1. Data Validation: ……………………………………40 b.4.. Selective Recording on added Application: …………. Inserting a Checkpoint after Recording: …………30 9.Software Testing Automation (QTP) ________________________________________________________________________ 8.2.40 9.5. Inserting a Bitmap Checkpoint after Recording:.32 b. To add Checkpoint while Recording: ………………...37 9. Selective Record on any Application: …………………..27 9. Inserting a Checkpoint During Recording: ………29 b.5.1. Checkpoints: ……………………………………………………………….39 9.27 8..3. Specify SQL Statements Manually: ……………40 a. Create Query using SQL Query: ……………….32 9.. Data Integrity: …………………………………….42 -5- Arcus Infotech (P) Ltd .28 9.2.3.31 a. Record & Run Settings: ………………………………………………. You can Define Database Checkpoint in a test To Check if: ……………………………………………………. Standard Checkpoint: ……………………………………….39 9.5. Data Validation: ……………………………………41 b.34 a.2..33 9.1. Database Checkpoint: ………………………………………. When Executing a Database Checkpoint.36 9. Text Area Checkpoint: ………………………………………..5. Bitmap Checkpoint: ………………………………………….5.. Inserting a Bitmap Checkpoint during Recording: ………………………………………………………………………35 b. Data Integrity: ……………………………………. Text Checkpoint: ……………………………………………….29 a.. the Following Events Occur: …………………………………. To add Checkpoints while Editing a Test: ……….4.

52 16. Text & Text Area Output Value: ……………………….. Call to Copy of Action: ………………………………………………. XML Output Value: ………………………………………….44 10.62 23.Software Testing Automation (QTP) ________________________________________________________________________ 9.1.7.54 17. Split Action: ………………………………………………………………55 19... Standard OutPut Value: ……………………………………46 10.4. Object Repository: …………………………………………………….57 20.. Reusable Action: ………………………………………………………. XML Checkpoint: ………………………………………………. Virtual Object: …………………………………………………………. Object Repository Manager & Associate Repository: ……. Delete Action: ……………………………………………………………55 18. Call to Existing Action: ………………………………………………. Rename Action: …………………………………………………………49 13..47 11.47 10.. Call to WinRunner: …………………………………………………….73 26. Recovery Scenario Manager: ………………………………………66 24. Start & End Transaction: …………………………………………….50 14.60 22. Call to New Action: ……………………………………………………. Object Spy: ………………………………………………………………. Accessibility Checkpoint: ……………………………………43 9.50 15. Merge Object Repositories: …………………………………………71 25.6.57 21.3.2.48 12. Database Output Value: ………………………………….47 10. Virtual Object Collection: ……………………………………………75 -6Arcus Infotech (P) Ltd . Output Value: ……………………………………………………………46 10.

77 27. Parameterize Through the KeyWord View: …………87 31. Environmental Variable: ………………………………….83 30.2..79 28.. User-Defined External: ……………………..Software Testing Automation (QTP) ________________________________________________________________________ 27. Data Driven Testing: ………………………………………………….92 33.. Step Generator: …………………………………………………………76 27. Parameterization: …………………………………………………….89 31.1.1.…. To Modify the Small Identification Properties: ……91 32.…. Build –In: ……………………………………….78 27. Breakpoint: ………………………………………………………………92 32.2..94 b.1.93 33. Add a Synchronization Point while Recording: ……82 30. Function Definition Generator: ……………………………………80 29.1.93 33. Types of Environmental Variable: ……………93 a. Object Identification: …………………………………………………89 31.3.82 29. Parameterize through Data Driver Wizard: …………84 30. Utility Objects: ………………………………………………. To Open the Object Identification Dialog Box: …. Insert / Remove Breakpoints: …………………………. Synchronization Point: ……………………………………………….3..94 c.…. Functions: ……………………………………………………..2..1.1.96 -7Arcus Infotech (P) Ltd ..1. Test Objects: …………………………………………………. Identifying Types of Object Class Properties: ……. User-Defined Internal: ……………………..89 31..1.

SQL Server: ………………………………………………….….2...104 36.103 36. Key-Word Driven Testing: …………………………………………106 -8- Arcus Infotech (P) Ltd . Oracle: …………………………………………………………102 35.2.1.99 34. Data Base Connecting: ……………………………………………….2.. Static Descriptive Programming: …………………….1.3.98 34. Internal Data Table Testing: ……………………. Data Table Method: …………………………………………97 a.Software Testing Automation (QTP) ________________________________________________________________________ 33.104 36. Flat Files: ……………………………………………………………….97 b.. Descriptive Programming: ………………………………………. MS Access: ……………………………………………………100 34.101 34. External Data Table Testing: ………………………….. Dynamic Descriptive Programming: …………………105 37.

How to decide what test cases to be automated? When we have a large number of test cases we have to carefully analyze them and group into categories and then decided if that test case should execute on every release/build of the application or not.Software Testing Automation (QTP) ________________________________________________________________________ 1. These kinds of test cases should not be automated unless you have full control of the backend processes to be run for successful completion of the test using QTP. If the test case is not intended to be executed on every release it should not be automated since if falls into a “one-time” testing category. 1.2. Introduction to QTP: 1. which can record the user actions. Some test cases might be very time consuming to automate where as executing them manually could be just a matter of 5 to 10 minutes. Some test cases may have manual intervention for example: when you create an account in the application someone in your team has to do run some batch processes manually in order for to continue either further testing.1. It can be used to test the functionality of the application in the regression testing phase. Such type of test cases should be given the least priority in terms of when to automate them. keyed in while recording and execute these user actions while we play back(run) test. -9- Arcus Infotech (P) Ltd . What is Quick test Professional? Quick test professional is a functional and regression testing tool from hp software .

Software Testing Automation (QTP) ________________________________________________________________________

1.3. How does QTP works? QTP has two components, VB Script Language. Object Repository. While recording the user actions on the applications QTP will generate the VB script statements, which indicate the actions it is supposed to perform. While recording, QTP will also learn the objects present in the application, say for example a window, checkbox, radio button etc., and stores these objects in a place called object repository. In order to run the test successfully the corresponding object exists in the object repository.

2. Testing Process:
The Quick Test Testing Process consisting of the following min phases to convert our selected manual Functional Testing cases into Automation Test Script: Planning Creating Tests or Component. Inserting Checkpoints into your test or components. Debugging Test Script. Running the Test Script. Analyzing the Result. Reporting Defects.

- 10 -

Arcus Infotech (P) Ltd

Software Testing Automation (QTP) ________________________________________________________________________

2.1. Planning: Before starting to build a test, you should plan it and prepare the required infrastructure. For example, determine the functionality you want to test, short tests that check specific functions of the application or complete site. Decide how you want to organize your object repositories. 2.2. Creating Tests or Component: We can create test or component by a.) either recording a session on your application or web site. As we navigate through the application or site, Quick test graphically displays each step we perform as a row in the keyword view. The documentation column of the keyword view also displays a description of each step in easy-to-understand sentences. A step is something that causes or makes a change in your site or application, such as clicking a link or image, or submitting a data form. (Or) b.) build an object repository and use these objects to add steps manually in the keyword view or Expert view. We can then modify

- 11 -

Arcus Infotech (P) Ltd

Software Testing Automation (QTP) ________________________________________________________________________ your test or component with special testing options and/or with programming statements.

2.3. Inserting checkpoints into your test or components: A checkpoint is a verification point that compares a recent value for a specified property with the expected value for the property. This enables you to identify whether the web site or application is functioning correctly. 2.4. Debugging Test Script: Broaden the scope of your test or component by replacing fixed values with parameters. To check how your application performs the same operations with different data you can parameterize your test or component. When you parameterize your test or component, Quick Test substitutes the fixed values in your test or component with parameters Each run session that uses a different set of parameterized data is called an iteration.

We can also use output values to extract data from our test or component. An output value is a value retrieved during the run

- 12 -

Arcus Infotech (P) Ltd

2. your test) If we for parameterized each set of the data test with we Data Table parameters. Running the Test Script: After creating test or component. We can subsequently use this output value as input data in your test or component. objects. We can also set breakpoints to pause the test or component .5. Run test or component to check the site or application.13 - Arcus Infotech (P) Ltd . We can use many functional testing features of Quick Test to improve your test or component and/or add programming statements to achieve more complex testing goals. checking any text strings.Software Testing Automation (QTP) ________________________________________________________________________ session and entered into the Data Table or saved as a variable or a parameter. We can control the run session to identify and eliminate defects in the test or component. We can use the Step Into. Step Over. Quick Test repeats the test (or specific actions in values defined. or tables you specified. we run it. Quick Test connects to your Web site or application and performs each operation in a test or component. Run the test or component to debug it. And Step Out commands to run a test or component step by step. When we run the test or component.

(If you already know Visual Basic or Visual Basic for Applications (VBA).6.7. We can instruct Quick test to automatically report each failed step in the test or component. 2.Software Testing Automation (QTP) ________________________________________________________________________ at pre-determined points. we can report the defects fond out to a database. we can view the results of the run in the Test Results window. 2. VBScript can be used to write both server side and client side scripting. Reporting Defects: If Quality Center is installed. or we can report them manually from the Test Results window. It was developed by Microsoft to provide more processing power to Web pages. once you learn VBScript.0 language. We can view the value of variables in the test or component each time it stops at a breakpoint in the Debug Viewer.14 - Arcus Infotech (P) Ltd . Analyzing the Result: After running the test or component.) . We can view a summary of the results as well as a detailed report. you are on your way to programming with the whole family of Visual Basic languages. What is VBScript? VBScript is a subset of Visual Basic 4. VBScript will be very familiar. 3. Even if you do not know Visual Basic.

1.Software Testing Automation (QTP) ________________________________________________________________________ 4. Quick Test Professional Window: The quick test window contains the following key elements: 4. Title Bar: this bar displays the name of the currently opened test. .15 - Arcus Infotech (P) Ltd .

4. Testing Toolbar: this toolbar contains buttons to assist us in the testing process. 4.2. Note: This debug toolbar is not displayed when you open quick test for the first time.16 - Arcus Infotech (P) Ltd .Software Testing Automation (QTP) ________________________________________________________________________ 4. File Toolbar: this bar contains buttons to assist us in creating and managing out test.5. You can display the debug toolbar by choosing View/ Toolbars/ Debug. Debug Toolbar: this toolbar contains buttons to assist us in debugging tests.3. . 4. Menu Bar: this bar displays menus of quick test professional commands. 4.

Software Testing Automation (QTP) ________________________________________________________________________ 4.6. Action Toolbar: This toolbar contains buttons and a list of actions, enabling us to view the details of an individual action or the entire test flow.

Note: This action toolbar is only displayed in the keyword view. It is not displayed when you open quick test for the first time. You can display the action toolbar by choosing view>toolbars> action. If you insert a reusable or external action in a test, the action toolbar is displayed automatically in the keyword view. 4.7. Test pane: the test pane contains the keyword view and expert view tabs. 4.8. Expert view:

- 17 -

Arcus Infotech (P) Ltd

Software Testing Automation (QTP) ________________________________________________________________________ • Scripts (Scripting) are written in Expert View. • Advanced testers can view and edit their tests in the Expert View. Any changes made in the Expert View are automatically synchronized with the Keyword View. In Expert view we can use different Scripting languages supported by QTP Ex - VBScript, JavaScript etc, to automate our Tests. • Expert view supports various build in functions and classes of scripting language we use to automate our tests. 4.9. Keyword View:

• Keyword view in QTP is also know as Icon Based view • Expert view which displays each and every operation we perform in the form of a script comprised of Statements but In Keyword View it displays as Tree Structure with object name and self generated description about the object • For each object and method in expert view statements there exists a row in keyword view. • Any modifications in Expert view will reflect in Keyword View and Vice Versa. - 18 Arcus Infotech (P) Ltd

Software Testing Automation (QTP) ________________________________________________________________________ • We can't directly delete an action in expert view but can in Keyword view. • We can modify the object in keyword view which will reflect in expert view. 4.10. Active Screen: It provides a snapshot f our application build as it appears when we perform a certain step during the recording session. It is easy to insert the checkpoints, output values, and easy to add objects to the object repository for recognizing objects. However, it occupies lot of memory space to store snap shots. You can display the Active Screen by choosing view>Active Screen

4.11. Data Table:
There are two types of Data Table: a. Defined Time Data Table:

- 19 -

Arcus Infotech (P) Ltd

Global sheet: This sheet is common for all the Actions in all test pages.12.20 - Arcus Infotech (P) Ltd . 4. b.Software Testing Automation (QTP) ________________________________________________________________________ The data table assists you in parameterize your test with multiple test data. This is one of the default sheets. The debug viewer pane contains the watch Expression. Runtime Data Table: This data table is available in the result window. Local sheet (Action 1): This sheet is used only for the particular action. The debug viewer pane is not displayed when you open Quick test for the . Here the data table consists of two types of sheets. Debug Viewer Pane: It assists us in debugging our test script. This data table also contains the same sheet which is available in the defined time data table. Variables and Command tabs.

21 - Arcus Infotech (P) Ltd . follow this path View>Debug Viewer. • Command: . When you continue the run session.The Command tab enables you to run a line of script to set or modify the current value of a variable or VBScript object in your script.Software Testing Automation (QTP) ________________________________________________________________________ first time. • Watch: . Quick Test uses the new value that was set in the command. the Variables tab displays the current value of all variables that have been recognized up to the last step performed in the run session. 5. Add-In Manager: . • Variables: .The Watch tab enables you to view the current value of any variable or VBScript expression that you added to the Watch tab. If you want to display the debug viewer.During a run session.

QTP creates executable statements in VB script.1. The default add-ins is Activex. 6.22 - Arcus Infotech (P) Ltd . In this phase. Recording QTP script: QTP allows you to record our manual operations in three types of modes-General recording.Software Testing Automation (QTP) ________________________________________________________________________ The Add-in Manager dialog box enables Quick Test Professional to recognize objects in the developed environment of AUT. 6. which are equal to our manual actions on build. the automation test creation starts with recording. What are the modes of recording? There are there modes . Generally. Low Level Recording. Analog Recording. The list of add-ins that appears in the Add-In Manager dialog box is dependent on your license. An add-in will be loaded if you check it in the Add-in Manager dialog box. Visual Basic and Web. Additional add-ins requires installing the appropriate software before launching quick test for the add-ins to appear in Add-in Manager.

To select this mode.Software Testing Automation (QTP) ________________________________________________________________________ General Recording. time-Based operations. Analog. a. General Recording: To record mouse and keyboard operations with respect to objects and windows in our application build. perform one of the options. c. Low level recording: To record mouse pointer movements on the desktop along with time.. .g. e. follow these options. To select analog Recording. we can use low level recording. Automation menu>Low Level recording. b. Low Level. To select this mode. follow one of the following procedures. like context sensitive mode in win runner. Shift+Alt+F3. Analog Recording mode: In this mode QTP records the mouse movements and key strokes on the keyboard as tracks so that it can help you in testing the situations like signature scanning or handwriting or drawing some objects on the screen or in a window etc. Automation Menu>Analog Recording. Shortcut key F3. Automation Menu>Record.23 Arcus Infotech (P) Ltd . Click record button in Testing Toolbar. we can use the general recording mode in QTP.

What are the modes of running test in qtp and what do they mean? There are three modes of replaying the test. a. These are not listed on the toolbar. When we need to run the test to update the checkpoints go to “automation” menu and select “update run mode”. This is the debug mode.2.Software Testing Automation (QTP) ________________________________________________________________________ Ctrl+Shift+F3. When we hit the run button we get the “run” dialogue box. Analog and low level recording modes can only be selected after starting to record and going to the automation menu. Verify mode: . The analog and low level recording modes can be selected only after hitting the record button.24 - Arcus Infotech (P) Ltd . which gives us two options. 6. Playback of QTP scripts: A. This is the verify mode. To save the result in temporary run result s folder overwriting the earlier results. To save the results in new run results folder. In the picture below the first icon is for analog recording and the second one is for low level recording.

Sequence of things happening when the script is played back: QTP’s inbuilt interpreter checks for the syntax errors in the script. c. B.25 - Arcus Infotech (P) Ltd . then an error window pops up depending on the situation. Update mode: If a test engineer wants to update the expected results while running the test. . b. say for example while recording the script the calendar date was 1020/2008 and while executing the test it is a different date(system date). Does the action/task specified in the script.Software Testing Automation (QTP) ________________________________________________________________________ If the test engineer wants to save the results of the test run to compare any verify with the future runs of the same test he would go with the verify mode. then the test should be run in the update mode otherwise the test would fail because of the changed properties of the object. Debug mode: If the test engineer does not want to save the results as he is yet to finish the script or he is testing his QTP coding logic he would run the test in the debug mode. It checks to see if the object specified in the script exists in the repository. During script execution if any of the above phases encounter the error. It checks if the object specified in the script exists on the application under test.

With QTP you will able to test . Quick Test Professional enables you to automate manual test cases.26 - Arcus Infotech (P) Ltd . Snapshots of the error messages: Syntax error: Object not found in the repository: Quick Test Professional is one of the Functional Testing & Regression Testing Tool. QTP is mercury’s advanced keyword-Driven Testing.Software Testing Automation (QTP) ________________________________________________________________________ 7. Quick test professional is a software testing tool that provides you an automated solution for functionality testing. This automation of test cases results in increased productivity of the testing team and increased reusability of tests.

it is mandatory in QTP when you click start recording button. .Net Java. Web Objects. .2. Record and Run Settings: 8. However. Active X Controls. Selective recording on added application: It is common for both window based application and web based application.Software Testing Automation (QTP) ________________________________________________________________________ Standard Windows Application. SAP.27 - Arcus Infotech (P) Ltd .1. Selective record on any application: It is common for both window based application and web based application. Visual Basic applications. 8. Siebel Oracle PeopleSoft 8.

28 - Arcus Infotech (P) Ltd . A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. Checkpoints: A checkpoint defines the observation on application build functionality to compare our expected value of manual case and the actual build value. .       Standard checkpoint. Database checkpoint. We can use the following checkpoints in qtp automate the functionality checklists or coverage. Accessibility checkpoint. we have to click add button to browse our required application paths. Text area checkpoint. 9.Software Testing Automation (QTP) ________________________________________________________________________ If you have to create test on specified applications. Bitmap checkpoint. This enables you to identify whether your Web site or application is functioning correctly. To Open Record and Run Settings Step 1: Click on Record Button in the Testing Toolbar. Text checkpoint.

.Software Testing Automation (QTP) ________________________________________________________________________   Xml Checkpoint (from application). We can use this checkpoint to verify the properties of objects. The standard checkpoint checks a variety of objects. etc. combo boxes.  Inserting a checkpoint after recording. 9. Inserting a checkpoint during recording: . such as buttons.29 - Arcus Infotech (P) Ltd . like as GUI checkpoint in winrunner. for example. Inserting Checkpoint: We can insert the checkpoint to the application by two methods  Inserting a checkpoint during Recording. a. Standard checkpoint: Standard checkpoint checks the property value of an object in your application or web page. lists. Xml checkpoint (from Resource). radio buttons.1. you can check whether a radio button is activated after it is selected or you can check the value of an edit field or you can check the focus of a default button.

If Active Screen is not active. Step 9: Execute the Script to verify the output in the Result window. The checkpoint Properties dialog box appears. Inserting a checkpoint after recording: To add a checkpoint after recording a test. The Object Selection – Checkpoint Properties dialog box appears. you are Active Screen to select the fields for which you want to add checkpoints. Step 6: Check the properties for which you want to add checkpoints and uncheck all other properties. Step 5: In the Object Selection – Checkpoint Properties dialog box. Step 7: Modify the value of the property (Expected Value).Software Testing Automation (QTP) ________________________________________________________________________ Step 1: Click on Record Button in Automation Menu or Record button in Testing Toolbar. Step 4: Now click on the applications object which you want to insert standard checkpoint. Step 2: Open the particular application that you want to insert the checkpoint. b. The value of the property appears in the Constant field.30 - Arcus Infotech (P) Ltd . if required. Step 8: Click on Ok to insert the Checkpoint. The cursor changes to a pointer hand. (Window Based Application or Web Based Application). click the Active Screen button. click OK. . Step 3: Open the Standard Checkpoint by Insert> Checkpoint> Standard Checkpoint.

The value of the property appears in the Constant field.Software Testing Automation (QTP) ________________________________________________________________________ To add a Standard checkpoint from Active Screen Step 1: On Active Screen. Step 6: Execute the Script to verify the output in the Result window.31 Arcus Infotech (P) Ltd . suppose a Web page displays the sentence Flight departing from New York to San Francisco. Step 4: Modify the value of the property (Expected Value). Step 2: Click OK. if required. Step 5: Click on Ok to insert the Checkpoint. You can create a text checkpoint that checks that the words “New York” are displayed between “Flight departing from” and “to San . The Object Selection-Checkpoint Properties dialog box appears. Step 3: Check the properties for which you want to add checkpoints and uncheck all other properties. The Checkpoint Properties dialog box appears. For example. Text Checkpoint: Text Checkpoint checks that a text string is displayed in the appropriate place on a Web page or application. 9.2. right click the object for which you want to add checkpoint and select Insert Standard Checkpoint from the menu.

Exact Match.or Web-based application. or click the Insert Checkpoint or Output Value button Checkpoint. • • • • This checkpoint compares our expected value with corresponding object in four ways: Match Case.32 - Arcus Infotech (P) Ltd . Step 4: Click the text string for which you want to create the checkpoint. we can use checkpoint. a. To validate the existence text is an object. and choose Text . The QuickTest window is hidden. Step 6: A checkpoint statement is added for the selected object. Step 3: Choose Insert > Checkpoint > Text Checkpoint. window. Step 2: Display the page. Step 5: Specify whether it is expected as constant or parameter and then click OK.Software Testing Automation (QTP) ________________________________________________________________________ Francisco”. To add a text checkpoint while recording: Step 1: Click on Record button. The Text Checkpoint Properties dialog box opens. Ignore Spaces. and the pointer changes into a pointing hand. or screen containing the text you want to check. Text not Displayed (allows blank space as valid) You can add a text checkpoint while recording or editing steps in a Windows.

Hence. The Active Screen displays the page or screen corresponding to the highlighted step. Text Area Checkpoint: Text area checkpoint checks that string is displayed within a defined area in an application build. b. Step 6: Click OK to close the dialog box. to validate the existence of text in the specified screen area. This . You can create a text area checkpoint to confirm that the number displayed on the button is same as the number entered in the form. it is better to use this checkpoint. where <Num> is replaced by a four digit code entered in a form elsewhere in the application. Step 2: Click the step where you want to add a checkpoint. Step 5: Specify the settings for the checkpoint. your Visual Basic application has a button that says View Doc<Num>. For Example. A checkpoint statement is added for the selected object.3.33 - Arcus Infotech (P) Ltd . Step 3: Highlight a text string on the Active Screen. according to specified criteria. The Text Checkpoint Properties dialog box opens. Step 4: Right-click the text string and choose Insert Text Checkpoint. 9.Software Testing Automation (QTP) ________________________________________________________________________ Step 7: Execute the Script to see the Result. To add a text checkpoint while editing a test: Step 1: Make sure the Active Screen button is selected.

and choose Text Area Checkpoint. Ignore Spaces. Step 2: Define the area containing the text you want Quick Test to check by clicking and dragging the crosshairs pointer. or click the arrow next to the Insert Checkpoint button pointer turns into a crosshairs pointer. Step 1: Choose Insert > Checkpoint > Text Area Checkpoint.34 - Arcus Infotech (P) Ltd .Software Testing Automation (QTP) ________________________________________________________________________ checkpoint allows four types of comparison between the expected value and selected screen area value: • • • • Match case. and the mouse . Text Not Displayed (Allows blank space as valid). The Quick Test window is hidden. Visual Basic. Release the mouse button after outlining the area required. If the area you defined is associated with more than one object. the Object Selection–Text Area Checkpoint Properties dialog box opens. You can add a text area checkpoint only while recording a test or component on Windows-based applications—Standard Windows.) Tip: Hold down the left mouse button and use the arrow keys to make precise adjustments to the defined area. (See Considerations for Defining the Text Area. and ActiveX. Exact Match.

By using the bitmap checkpoint. test engineers select multimedia option in the Add-in Manager. The map has control keys for zooming. Bitmap Checkpoint: Bitmap checkpoint checks an area of your web page or application as a bitmap. Let us take another example. For Example. Winrunner allows the static images only for comparison. QTP allows static images and dynamic images for comparison. To compare dynamic images. old map and new map. if required. You can record the new map that is displayed after one click on the control key that zooms the map. you have a web site that displays a map of a city which is specified by a user. Suppose you have an application newly build that can display your company log.Software Testing Automation (QTP) ________________________________________________________________________ Step 3: Select the object for which you are creating the checkpoint. This checkpoint covers full images or. . you can check that logo through the comparison of both the old build version logo and the current new build version logo for correctness. However. The Text Area Checkpoint Properties dialog box opens. A checkpoint statement is added for the selected object in the Keyword View and Expert View. Step 5: Click OK to close the dialog box. part of images. Pixel by Pixel.35 - Arcus Infotech (P) Ltd .4. Step 4: Specify the checkpoint settings. You use a bitmap checkpoint to compare an expected image to the actual image at run time. You can record the new logo and using the bitmap checkpoint. you can check whether the map zooms in correctly comparing with both. 9.

The cursor changes to a pointer hand.Software Testing Automation (QTP) ________________________________________________________________________ A bitmap checkpoint can be added to a test in two ways: a. Step 6: The Bitmap Checkpoint Properties dialog bo x displays the bitmap that you want to check. Step 3: Open the Standard Checkpoint by Insert> Checkpoint> Bitmap Checkpoint. .36 - Arcus Infotech (P) Ltd . The Bitmap Checkpoint Properties dialog box appears. Step 5: Click OK to close the Object Selection –Bitmap Checkpoint Properties dialog box. The Object Selection-Bitmap Checkpoint Properties dialog box appears. (Window Based Application or Web Based Application). Step 7: Click OK to close the Bitmap Checkpoint Properties dialog box. Step 2: Open the particular application that you want to insert the checkpoint. Step 4: Use the pointer hand cursor to select the bitmap that you want to check. Inserting a bitmap checkpoint during Recording: Step 1: Click on Record Button in Automation Menu or Record button in Testing Toolbar. Step 8: Execute the script to analyze the result in the Result window.

Software Testing Automation (QTP) ________________________________________________________________________ b. Inserting a Bitmap checkpoint after recording: To add a checkpoint after recording a test. if required. Step 5: Click on Ok to insert the Checkpoint. If Active Screen is not active. To add a Bitmap checkpoint from Active Screen: Step 1: On Active Screen. . Step 3: You want to check Bitmap for particular area means. The Checkpoint Properties dialog box appears. The Object Selection-Bitmap Checkpoint Properties dialog box appears. you are Active Screen to select the fields for which you want to add checkpoints. Step 2: Click OK.37 - Arcus Infotech (P) Ltd . right click the object for which you want to add checkpoint and select Insert Bitmap Checkpoint from the menu. click on Select Area button and select the particular area in the image. click the Active Screen button.

. the test engineers validate the impact of front-end operations on backend table’s content in terms of Data Validation and Data Integrity. In backend-testing. Database Checkpoint: To automate backend testing on our application build. Data Validation means that the correctness of front-end values which are stored into backend tables. 9.Software Testing Automation (QTP) ________________________________________________________________________ Step 6: Execute the Script to verify the output in the Result window.38 - Arcus Infotech (P) Ltd .5. test engineers use database checkpoint. (or) It is nothing but to check whether the new values entered in the front end. that same value will be entered in the database or not.

length and Spacing. You can define database checkpoint in a test to check if: • • The data is saved to the correct tables and columns of the database. Quick test gathers the result set of query. the following events occur: 1.1. 2. 3. Some of the properties that you check for data type.Software Testing Automation (QTP) ________________________________________________________________________ Data Integrity means that the impact of newly stored values on existing values of database tables. 9. Quick test compares the actual data with the expected data. This process is also called as data Presistence. which is stored in the database checkpoint.39 - Arcus Infotech (P) Ltd . or deleted in the AUT (Application under Test).5. format. The data is updated in the database when a record is inserted. which provides the actual data. • The data entered using the AUT is represented correctly in the database. 9. updated. There are Two Ways to open Database in QTP by . The test arrives at the database checkpoint step and connects to the database.2. When executing a database checkpoint. • The data entered into the database is not duplicate. Quick test sends a query to the database to retrieve the actual data.5. to determine if the test passed or failed. 4.

Software Testing Automation (QTP) ________________________________________________________________________  Create Query using Microsoft Query. Step 2: To insert Checkpoint. Specify SQL Statements Manually option and click on Next. here we want to insert the Database Path for that click on Create. Click on Machine Data Source.  Specify SQL statements manually. Step 3: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed. Data Integrity: . Specify SQL Statements Manually: a. Step 5: The Database Query Wizard-‘Specify SQL Statement’ Screen get displayed. Step 7: Select Particular Database eg: QT_Flight32.5. then check the Result for Data Validation. Step 6: Select Data Source Screen Displayed.3. 9. Step 9: Now it displays the database for the application. and click on Finish. Data Validation: Step 1: Open the Application and Enter the New Values in the Front End. Step 4: Choose.40 - Arcus Infotech (P) Ltd . Click on Insert>Checkpoint>Database Checkpoint. click on OK. Step 8: Enter the SQL Query in Database Query Wizard-‘SQL Statement’ field as “select * from orders” to open the full Database. b.

Data Validation: Step 1: Open the application and enter the new values in the Front End.41 - Arcus Infotech (P) Ltd . Click on Insert>Checkpoint>Database Checkpoint.Software Testing Automation (QTP) ________________________________________________________________________ Step 1: Open the Application and open the Existed data from the database in Front End. . Click on Insert>Checkpoint>Database Checkpoint. Step 10: Now it displays the database for the application. and click on Finish.4. Create Query using SQL Query: a. Specify SQL Statements Manually option and click on Next. Click on Machine Data Source. Step 5: Choose. click on OK. Step 9: Enter the SQL Query in Database Query Wizard-‘SQL Statement’ field as “select * from orders” to open the full Database. then check the Result for Data Integrity. Step 2: To insert Checkpoint. Step 7: Select Data Source Screen Displayed.5. Step 8: Select Particular Database eg: QT_Flight32. Step 6: The Database Query Wizard-‘Specify SQL Statement’ Screen get displayed. here we want to insert the Database Path for that click on Create. Step 4: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed. 9. Step 2: Modify the value in the Front End. and Click on Update the Value. Step 3: To insert Checkpoint.

Step 10: Select Exit and return to Quick Test Professional Radio Button in Query Wizard Finish screen to display the value in the Data table. Step 7: Query Wizard-Choose Column Screen Displays. Step 11: Select View data or Edit query in Microsoft Query Radio Button in Query Wizard Finish Screen to Display the value in the Microsoft Query. Data Integrity: Step 1: Open the Application and open the Existed data from the database in Front End.42 - Arcus Infotech (P) Ltd . Click on Insert>Checkpoint>Database Checkpoint. sort it in Query WizardSort Order. and click on next.Software Testing Automation (QTP) ________________________________________________________________________ Step 3: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed. Step 12: Analyze the Result. Step 3: To insert Checkpoint. Step 8: If you want filter the column name means filter the column name in the Query Wizard-Filter data. and Click on Update the Value. . Step 4: Choose. b. Click on Next. Create Query using Microsoft Query and click on Next. Click on next. Step 6: Choose Data Source Screen opens. Step 9: if you want to sort the column means. E. Step 5: Choose. from this select the Column you want to add to Data table. from this screen choose the Database.: QT_Flight32*. Step 4: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed. Step 5: Instruction for Microsoft Query Screen Displays and click on OK. and click on OK. Step 2: Modify the value in the Front End. Create Query using Microsoft Query and click on Next.g.

and click on OK. Step 12: Select View data or Edit query in Microsoft Query Radio Button in Query Wizard Finish Screen to Display the value in the Microsoft Query. Step 11: Select Exit and return to Quick Test Professional Radio Button in Query Wizard Finish screen to display the value in the Data table. check if the images on a Web page include ALT properties. Step 8: Query Wizard-Choose Column Screen Displays. Step 7: Choose Data Source Screen opens.43 Arcus Infotech (P) Ltd .: QT_Flight32*. Step 9: If you want filter the column name means filter the column name in the Query Wizard-Filter data. and click on next. For example. Click on Next. E. from this select the Column you want to add to Data table. Accessibility checkpoints are supported for the Web add-in environment (or) The Section 508 criteria for Web-based technology and information systems are based on access guidelines developed by the Web Accessibility Initiative of the World Wide Web Consortium (W3C).6.Software Testing Automation (QTP) ________________________________________________________________________ Step 6: Instruction for Microsoft Query Screen Displays and click on OK. required by the W3C Web Content Accessibility Guidelines. from this screen choose the Database. Step 13: Analyze the Result.g. Step 10: if you want to sort the column means. sort it in Query WizardSort Order. Accessibility Checkpoint: Accessibility Checkpoint recognizes areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines. 9. You can add accessibility checkpoints to help you quickly identify areas of . Click on next.

44 - Arcus Infotech (P) Ltd .Software Testing Automation (QTP) ________________________________________________________________________ your Web site that may not conform to the W3C Web Content Accessibility Guidelines. XML Checkpoint: You create XML file checkpoints to directly access and verify specific XML files in your system. Step 2: Select Create new checkpoint from file. The XML Source Selection . or you can add individual accessibility checkpoints to individual pages or frames. 9. and select XML Checkpoint (From Resource). Alternatively.7. You can create an XML file checkpoint while you are recording or editing your test. To create an XML file checkpoint: Step 1: Choose Insert > Checkpoint > XML Checkpoint (From Resource) or click the Insert Checkpoint or Output Value toolbar button . click the browse button to open the Open XML File dialog box. Enter the file path or Internet address of the XML file.Checkpoint Properties dialog box opens. and then navigate to the XML file for which you want to create a . You can add automatic accessibility checkpoints to each page in your test.

45 - Arcus Infotech (P) Ltd . Step 4: In the Name box. does not begin or end with a space. You can specify an XML file either from your file system or from Quality Center. The XML Checkpoint Properties dialog box opens. The file path and name are entered in the box. make sure that the name is unique. Select the file and click Open. either accept the name that QuickTest assigns to the checkpoint or specify another name for it. the checkpoint name is the name of the test object on which the checkpoint is being performed.Software Testing Automation (QTP) ________________________________________________________________________ checkpoint. and does not contain the following character/combination of characters: " := @@ . If you rename the checkpoint. By default. Step 3: Click OK in the XML Source Selection .Checkpoint Properties dialog box.

Check CheckPoint("availcities.46 Arcus Infotech (P) Ltd .1. 10. You can use standard output values to output the property values of most objects. QuickTest inserts this step as follows in the Expert View: XMLFile("availcities.Software Testing Automation (QTP) ________________________________________________________________________ Step 5: Select the items to check for the checkpoint Step 6: When you finish setting your checkpoint preferences. • You can use standard output values to output text strings by specifying the text property of the object as an output value. Text Output Value & Text Area Output Value: You can use text output values to output text strings displayed on a Web page or application. the number of links on a Web page may vary based on the selections a user makes on a form on the previous page. you can . These values can be used later in the different point in application. A checkpoint similar to the following is added to the Keyword View.2. You could create an output value in your test to store the number of links on the page.xml"). click OK to add the XML checkpoint. Standard Output Value. 10. For example. Output Value: Output value is a step in which one or values captured at a specific point in your test or component and stored for duration of the run session. in a Web-based application.xml") 10. When creating a text output value.

suppose that you want to store the text of any error message that appears after a specific step in the Web application you are testing. for example Error. or from a part of it. you can view summary results of the XML output values in the Test Results window. Quick test retrieves the current data from the database and outputs the values according to the settings that you specified. You can use XML output values to output the values of XML elements and attributes in XML documents.4. Inside the If statement. Database Output Value: You can use database output values to output the value of the contents of database cells.47 - Arcus Infotech (P) Ltd . You can create output values from the entire contents of the result set. You can use text area output values to output text strings displayed within a defined area of a screen in a Windows application. XML Output Value (From Application) & XML Output Value (From Resource). based on the results of a query (result set) that you define on a database. you output the text in this window (assuming that the window size is the same for all possible error messages). . You can also view detailed results by opening the XML Output Value Results window. you check whether a window exists with a known title bar value.3. After the run session has finished.Software Testing Automation (QTP) ________________________________________________________________________ output a part of the object's text. 10. During the run session. 10. For example. If it exists. You can also specify the text before and after the output text.

suppose that an XML document in a Web page contains a price list for new cars. The Insert Call to New Action dialog box .Software Testing Automation (QTP) ________________________________________________________________________ For example. To create a new Action in your Test: Step 1: Choose Insert > Call to New Action or click the Insert Call to New Action button opens. You can output the price of a particular car by selecting the appropriate XML element value to output. . 11.48 - Arcus Infotech (P) Ltd . Call To New Action:You can create new actions and add calls to them during a recording session or while designing or editing your test.

Step 4: Choose the location of the new action. Step 1: Select Edit>Action>Rename Action. Rename Action: To make your test easy to understand provide descriptive names to each action. 12. type the name of the Action. To modify an action name. Step 3: In the Name Field. Step 5: Click OK. .49 - Arcus Infotech (P) Ltd .Software Testing Automation (QTP) ________________________________________________________________________ Step 2: Insert Call to New Action dialog box appears.

Reusable Action: An action that can be called multiple times by the test with which it is stored (the local test). including checkpoints. 14. as well as by other tests. After Renaming the actions name. Step 3: Rename Action dialog box appears. and click on OK. Step 4: Click on OK to apply the Reusable Action. the original action is copied in its entirety.50 - Arcus Infotech (P) Ltd . all the actions will be arranged in the alphabetical order but during execution the QTP execute the Action (Script) which was created first. Other testers might start calling the action as soon as you make it reusable. Note: you should make an action Reusable only after you record and enhance your tests completely. Step 1: select the particular action in Action toolbar. the corresponding action tab in the Data Table. Call to Copy of Action: Inserting Calls to Copies of Actions When you insert a call to a copy of an action into a test. Step 2: Select Edit>Action>Action Properties. in this dialog box under General tab select Reusable Action Checkbox at the Bottom of the Left. 13. Step 4: Modify the name in the New Name. parameterization.Software Testing Automation (QTP) ________________________________________________________________________ Step 2: Another Method Shift+F3. plus any defined action . Step 3: Action Properties dialog box opens.

Software Testing Automation (QTP) ________________________________________________________________________ parameters. the copied action's local object repository is also copied together with the action. or right-click any step and select Action > Insert Call to Copy. To create a copy of an action and call the copy in your test: Step 1: While recording or editing your test. and changes you make to the original action do not affect the copied action. . non-reusable action (even if the original action was reusable). you can add to. If the test you are copying has objects in the local object repository. right-click an action icon and select Insert Call to Copy of Action. or modify the action just as you would with any other non-reusable action. Before applying call to copy of action we need to apply reusable action and save it. The Select Action dialog box opens. The action is inserted into the test as an independent. delete from.51 Arcus Infotech (P) Ltd . choose Insert > Call to Copy of Action. The Action box displays all local actions (actions that are stored with the test you selected). Step 2: Use the From test browse button to find the test containing the action you want to copy. Any changes you make to this action after you insert it affect only this action. Once the action is copied into your test.

If you chose to use the original action's data when you call an external action. Inserting a call to an existing action is similar to linking to it. Step 6: Click on OK to copy the Action. This helps you identify the action you want to copy. The modifications apply to all tests that call that action. To modify a called. you can choose. external action. When you select an action. Step 4: Select Edit new action Properties Checkbox to modify the script after inserting. its type (Non-reusable or Reusable Action) and description. select the action you want to insert. or in any other test (external action). editable copy. however. Call to Existing Action: You can insert a call to a reusable action that is stored in your current test (local action). but you cannot modify them. then changes to the original action's data are applied as well. or whether you want to use the (read-only) data from the original action. you must open the test with which the action is stored and make your modifications there. To insert a call to an existing action: . if one exists. The called action's local object repository (if it has one) is also read-only. are displayed. If you call an external action. Step 5: In location field select After the Current Step if it is Reusable action.52 - Arcus Infotech (P) Ltd .Software Testing Automation (QTP) ________________________________________________________________________ Step 3: In the Action list. You can view the steps of the action in the action view. whether you want the data from the action's data sheet to be imported as a local. 15.

are displayed. When you select an action. 16. its type (Non-reusable or Reusable Action) and description. The Select Action dialog box opens. Step 5: Click on OK to copy the Action. This helps you identify the action you want to call. select the action you want to insert.53 - Arcus Infotech (P) Ltd . if one exists. or right-click any step and select Action > Insert Call to Existing. The Action box displays all local actions (actions that are stored with the test you selected). Step 3: In the Action list. Call to WinRunner: . Step 2: Use the From test browse button to find the test containing the action you want to copy.Software Testing Automation (QTP) ________________________________________________________________________ Step 1: Choose Insert > Call to Existing Action. Step 4: In location field select After the Current Step if it is Reusable action. right-click an action icon and select Insert Call to Existing Action.

RunTestEx statement in the Expert View. The Call to WinRunner Test dialog box opens. opens the test. To insert a call to a WinRunner test using the Call to WinRunner Test dialog box: Step 1: Choose Insert > Call to WinRunner > Test. You can insert a call to a WinRunner test using the Call to WinRunner Test dialog box or by entering a TSLTest. and runs it. . it starts WinRunner.54 - Arcus Infotech (P) Ltd . enter the path of the WinRunner test or browse to it.Software Testing Automation (QTP) ________________________________________________________________________ When QuickTest links to WinRunner to run a test. Information about the WinRunner test run is displayed in the QuickTest Test Results window. Step 2: In the Test path box.

to insert the Script in the QTP. The action’s local data sheet is also removed. Step 4: Click on OK. the second action starts with the step that is selected when you perform the split action operation. just select Close winrunner after running the test for closing the winrunner after executing the script it automatically closes the Win runner. Delete Action: Delete action is to delete the Action from the test. Step 3:Particular Action will be Deleted. Step 2: Select Edit >Action>Delete Action. 18. Step 5: Execute the Script to analyse the Result. When you split an action. 17. When you delete a reusable action from a test. You cannot split an action and the option is disabled when: • • • • • an external action is selected the first step of an action is selected recording a test running a test you are working with a read-only test .55 - Arcus Infotech (P) Ltd . Split Action: You can split an action that is stored with your test into two sibling actions or into parent-child nested actions. the action is removed from the test flow list. Step 1: Select the particular action you want to delete. The original action is not affected.Software Testing Automation (QTP) ________________________________________________________________________ Step 3: After opening the winrunner file.

Step 4: The Split Action dialog box appears. Start Transaction and End Transaction: . in the Name field.Software Testing Automation (QTP) ________________________________________________________________________ When you split an action in your test that uses a local object repository: • • Quick Test makes a copy of the local object repository. • To Split an Action: Step 1: Enter the Script for the particular application. 19. the new objects are added only to the corresponding local object repository. Step 8: Click OK to close the Split Action dialog box. type a name for the second action. If you add objects to one of the split actions. type a name for the first action. in the Name field.56 - Arcus Infotech (P) Ltd . Step 6: In the 1st Action Section. Step 2: Insert the Cursor on the Particular line you want to split.  Nested: Creates parent and child actions. select one of the following options:  Independent of each Other: Creates two new independent actions. Step 9: Analyze the Result for Split Action. Step 5: In the Action Are Section. Step 7: In the 2nd Action Section. Step 3: Select Edit>Action>Split Action. where the last step in the parent action calls the child action. The two actions have identical local object repositories containing all of the objects that were in the original local object repository.

. Step 8: End Transaction dialog box appears.Software Testing Automation (QTP) ________________________________________________________________________ It is used to find the execution time of enclosed VB script Statements. Step 12: Execute the script to Analyze the Result. Step 5: Then enter the start transaction Name.57 Arcus Infotech (P) Ltd . Step 9: Then Enter the End Transaction Name. Step 3: Click on Insert>Start Transaction. Eg: Login. Inserting Start and End Transaction: Step 1: Enter the Script in the test. 20. Step 6: Select Insert Statement as Before Current Step. Each transaction name should have an associated Start Transaction and End Transaction. Step 2: Place the cursor at the required place in the test Script to enclose. A transaction can be inserted anywhere in your test. Step 7: Click on Insert>End Transaction. click on OK. Step 10: Select Insert Statement as After Current Step. but must start and end within the same action. The Start Transaction statement must appear before the associated End Transaction. Click on OK. Eg: Login. you can view the supported properties and methods of any object in an open application. Step 4: Start Transaction dialog box appears. Step 7: Now Start Transaction Script will be inserted in front of the current step you selected. Step 11: Now End Transaction Script will be inserted at the end of the current step you selected. Object Spy: Object spy is used to identify the applications objects properties. (or) Using the Object Spy pointing hand mechanism.

This enables you to visually distinguish between the various test objects in the application. the syntax is also displayed.Software Testing Automation (QTP) ________________________________________________________________________ As you move the pointing hand over the objects in the application.58 - Arcus Infotech (P) Ltd . and the methods associated with the object. In most environments. click the Methods tab. the Properties tab is displayed by default. the test object is also highlighted in the application as you move the pointing hand over it. For methods. Step 2: Choose Tools > Object Spy or click the Object Spy toolbar button to open the Object Spy dialog box and display the Properties tab. Otherwise. Step 3: Object Spy dialog box appears. . their details are displayed in the Object Spy. you can choose to view the test object properties and methods or the run-time (native) properties and methods. In some environments. o Click Run-time Object Properties or Test Object Properties. o To view the object's available methods and syntax. Step 4: Select the details you want to view for the object. These details may include the test object's hierarchy tree. enabling you to view the object's properties and their values. its properties and values. Step 1: Open your application to the page containing the object on which you want to spy.

or a method's syntax to the Clipboard. As you move the pointing hand over the test objects in your application. and you can view their test object properties or methods in the Object Spy dialog box.Software Testing Automation (QTP) ________________________________________________________________________ Step 5: In the Object Spy dialog box. click the property. click the pointing hand . You can also view their parent objects in the object hierarchy tree area of the Object Spy dialog box. Quick Test is hidden. The Object Spy displays the object hierarchy tree and the properties or methods of the object that is selected within the tree.59 - Arcus Infotech (P) Ltd . The value is displayed in the selected property/value or method syntax box (located above the Description box). value. Step 7: If you want to copy an object property or value. or method to highlight it. Step 6: Highlight or click the object whose properties or methods you want to view. the test objects are highlighted. Highlight the text in .

Quick test creates separate local object repositories for each new action. 21. To use Object Repository: Step 1: Open the Application that you want to Recognize. .60 - Arcus Infotech (P) Ltd . This local object repository is the default type of object repository. Quick test automatically saves the information about the objects that you record in the local object repository. A local object repository stores objects associated with a specific action.Software Testing Automation (QTP) ________________________________________________________________________ the box and use CTRL + C to copy the text to the Clipboard or right-click the highlighted text and choose Copy from the menu. When you record a test. Quick test creates a new local object repository that store objects used in the action. Object Repository is used to Recognize each and every objects to QTP. When you create an action in a test. We unable to share the captured objects to any other test. Object Repository: This Object Repository is also called as Local Repository. Step 3: Object Repository-All Object Repository dialog box appears. Step 2: Select Resource menu>Object Repository. so that only that action can access the stored objects. Because we can use the captured objects only for the particular test.

by using this Symbol click on the application (Which you want) to Recognize to the QTP.61 - Arcus Infotech (P) Ltd . Step 9: Close the Object Repository-All Object Repository dialog box. Click on OK. Step 8: Now in the Object Repository.Software Testing Automation (QTP) ________________________________________________________________________ Step 4: Select Object> Add Objects to Local to add the objects to Local Repository (or) click on Add Objects to Local icon in Tool Bar. select All Object types Radio Button to capture all the objects in the Application for Recognition. Step 10: Now just enter the script in the test.All Object Repository dialog box captures all the objects for application. Step 7: Define Object Filter dialog box appears. Step 5: After Clicking Add Objects to Local it shows Hand Symbol. Step 6: After Capturing Object Selection-Add to Repository dialog box appears. Click on OK. .

Now we can share this captured action to any test. If you plan to use shared objects in a test. Step 2: Open the Object Repository Manager by Resources>Object Repository Manager. You specify the shared object repositories that you want to use for an action in a test before you record a test. .62 - Arcus Infotech (P) Ltd . A Shared object repository can be used for multiple tests.Software Testing Automation (QTP) ________________________________________________________________________ 22. Object Repository Manager & Associate Repository: Object Repository Manager is also called as Shared Repository. By Using Object Repository Manager we are Capturing some objects and saving this captured objects but we are not recognizing anything to the QTP. you can create a shared object repository before you create the test. Step 3: Object Repository Manager Dialog box appears. To create and manage shared object Repositories Step 1: Open the Application that you want to Capture. You can also create new shared object repositories and associate these repositories with an action in a test after you record the test. Multiple shared object repositories can store shared objects.

select All Object types Radio Button to capture all the objects in the Application for Recognition. Click on OK.Software Testing Automation (QTP) ________________________________________________________________________ Step 4: Select Object> Add Objects to add the objects to Repository Manager (or) click on Add Objects icon in Tool Bar. . Step 8: Now in the Object Repository Manager dialog box captures all the objects from the application. Click on OK. Step 5: After Clicking Add Objects to Local it shows Hand Symbol.63 - Arcus Infotech (P) Ltd . Step 6: After Capturing Object Selection-Add to Repository dialog box appears. Step 7: Define Object Filter dialog box appears. by using this Symbol click on the application (Which you want) to Capture the Objects.

Note: You want to use Object Repository Manager compulsorily we want to Use Associate Repository for Recognition Purpose. Note: Now we want to recognize the saved Repository to write the Script.Software Testing Automation (QTP) ________________________________________________________________________ Step 9: Now Click on Save Button to save the Captured Objects in the Repository Manager. . For Recognition purpose use Associate Repository. Step 10: Now just close the Object Repository Manager. Step 12: Associate Repository dialog box appears. Note: Now if you try to write the script in the test it will not accept your script because we used Object Repository Manager only for Capturing not for Recognition.64 - Arcus Infotech (P) Ltd . Step 11: To Open Associate Repository Resources>Associate Repository.

and then click on Ok to Recognize the Repository. Button to open the saved Step 13: Select the Action 1 in the Available Action Field and click on button to add the Action to Associate Actions.65 - Arcus Infotech (P) Ltd . Note: .Software Testing Automation (QTP) ________________________________________________________________________ Step 12: Click on Add Repository Repository. Step 14: Now Enter the Script in QTP.

appear during a test run. Screen. For Example. Save a shared object Repository. These unexpected errors and events are called exception. Events that are expected to occur during a test run are not called exceptions. Modify an object in a shared object repository. the message box that appears when you enter a bad password is an expected event. Add objects to a shared object repository. or Module that needs to be tested. Similarly. Associate Object Repositories to actions. . In the Object Repository Manager you can: • • • • • Create a shared object Repository. Recovery Scenario Manager: Identifying Exceptions: Unexpected events during a test run disrupt a test or may give invalid test result.66 - Arcus Infotech (P) Ltd . an exception occurs if notification messages. This error does not permit the automated test to navigate to the feature. you need to identify the exceptions that can occur during a test run and take appropriate action to handle the exceptions. For Example. Introduction to a Recovery Scenario: To successfully complete a test run.Software Testing Automation (QTP) ________________________________________________________________________ Use the Object Repository Manager to manage all shared object repositories at one central location. For example. during a test run. An exception could occur in the AUT or an exception could occur because sources are external to the AUT. an application error may occur. such as you have mail or Printer out of Paper. the prompt to save changes or enter details in a mandatory field are expected events. 23. You cannot classify these events as exceptions.

after an exception is handled. For Example. select Resources>Recovery Scenario Manager.Software Testing Automation (QTP) ________________________________________________________________________ You can create recovery scenarios in Quick Test Professional to handle exceptions that occur during a test run. To create Recovery Scenario: Step 1: Enter invalid input in the application. you may want Quick Test to restart a test from the beginning. • Recovery: Instructs Quick Test how to handle the exception. After you create a recovery scenario. For Example. the test may be interrupted by an error pop-up window. Post-Recovery: Instructs Quick Test how to proceed after the recovery operations are performed. The Recovery Scenario Manager Dialog box appears. For Example. . Now it shows the pop-up message. Step 2: From the Quick Test Professional menu bar. A recovery scenario consists of the following components: • Trigger: Specifies the exception that may occur during a run session. you can instruct Quick Test to click a button on the error pop-up window to close the window. you can associate it with one or more tests.67 - Arcus Infotech (P) Ltd . and execute the Script.

you identify the event type that can disrupt a test run. The Select Trigger Event appears. Note: In the first component of a Recovery Scenario. click Next. Step 5: Select Popup Trigger Event. Application Crash: If an open application fails.Software Testing Automation (QTP) ________________________________________________________________________ Step 3: In the Scenario Section. you specify the conditions that can help Quick Test identify the correct event during a test run. . click the New Scenario button to display Recovery Scenario Wizard. Test Run Error: If a step in the test fails. click the Pointing hand button. Object State: If a mismatch occurs between the expected and the actual state of an object in the test. Step 4: Click Next. To select a trigger Event type: • • • • Popup Window: if a popup window appears in an open application.68 Arcus Infotech (P) Ltd . Step 7: On the Specify Pop-up Window Conditions page. and click the Pop-up error message box that you want the recovery scenario to handle. Note: After you select a trigger event type.

. Step 18: Now Remove the Control Button and Capture the Cancel Button in the application to close the Application. Step 19: Click on Next. Step 20: Remove the Add another Recovery Operation Checkbox to Stop adding Recovery Operation. Note: After you specify the recovery operation. identify the operation that you want to perform when the recovery operation complete. Step 21: Click on Next. you specify the recovery operation(s) required to handle the trigger event.Software Testing Automation (QTP) ________________________________________________________________________ Step 8: The Window Title and the Window Text Contains fields display the conditions to identify the Pop-up window. Step 13: Click on Hand Button to capture the buttons in the Pop-up error message. Step 17: Press Control Button to Deactivate the Capture and click on OK in the error pop-up message. click on Next. Step 11: Select Keyboard or Mouse Operation. it performs a key press or a mouse click recovery operation. To identify the recovery operation.69 - Arcus Infotech (P) Ltd . Step 12: Select Next to select a recovery operation. Step 16: Next>Keyboard or Mouse Operation>Next>Click Buttons with Label>Click on Hand button. Step 9: Click Next. Step 14: Now it captures the Ok button. Step 15: Click Next to Capture another button. Note: After you specify the trigger event type and the trigger event conditions in Recovery Scenario Wizard. The Recovery Operation Page appears. such as Click Button with Label. Step 10: No need to enter anything now. click Next.

check the Add Scenario to Current Test Check box. Click on Next. Step 24: Click on Next. Step 29: To add an existing recovery scenario to a test.Software Testing Automation (QTP) ________________________________________________________________________ Step 22: Select Proceed to next test iteration Radio button in Post Recovery Test Run Options to apply no of iterations to the recovery. click the Add button. Step 28: In Recovery Scenario Manager. you use the Name and Description page to provide a name and Description for the recovery scenario.70 - Arcus Infotech (P) Ltd . Note: After you identify a trigger event and select the recovery and Post-Recovery operations for a recovery scenario. The Recovery Scenario Manager Dialog box appears. . Click Finish. click the Recovery tab. and click Close to close the Recovery Scenario Manager. Step 31: Defaultly the Saved Recovery will be available. save the recovery scenario to a file. Step 25: The Completing The Recovery Scenario Wizard page displays the details of the recovery scenario in the Scenario Settings Section. Step 33: Execute the Script to Analyze the Result. Step 32: Browse the Saved Recovery to the particular test. Note: After you create a recovery scenario. Step 30: In the Settings dialog box. Step 23: In Scenario Name field enter the name for the Scenario you created and enter the Description in the Description field (Optional). From the Quick Test Professional Menu bar select File>Settings. Step 26: To associate the recovery Scenario with the current test. Click OK to apply the Scenario to the test. Step 27: To save the recovery Scenario. click Save button to save the Scenario. if it not Available.

To merge two object repositories: Step 1: In the Object Repository Manager. The New Merge dialog box appears. Merge Object Repositories: Two shared object repositories can be merged into a single object repository. When you merge two shared object repository. select Tools>Object Repository Merge Tools. This is done in the Object Repository Manager. . a Third object repository called Target object Repository gets created.71 - Arcus Infotech (P) Ltd .Software Testing Automation (QTP) ________________________________________________________________________ 24. the primary object repository and the Secondary object repository.

The Object Repository-Merge Tools window appears.72 - Arcus Infotech (P) Ltd . Step 5: Click Close. type or select the names of the object repositories that you want to merge. Step 7: Then recognize it to the QTP by using Associate Repository. Step 8: Enter the Script.Software Testing Automation (QTP) ________________________________________________________________________ Step 2: In the New Merge dialog box. The message box displays the details of the conflicts and the number of unique items merged from the two repositories. . Step 3: Click OK. Step 6: Save the target object Repository. It displays the objects in the target object repository. Step 4: The Statistics message box appears.

When you record a test that uses a virtual object. Quick test uses the information in the object repository to recognize the virtual object test playback. such as a button or a check box. the virtual object is displayed as though it is a standard class object. the Web site matches the coordinates of the click on the bitmap and opens the destination page. Quick Test clicks the bitmap in the area defined as a virtual object so that the Web site opens the correct destination page. Quick test learns the information about the boundaries associated with the Virtual Object along with the Standard object type that the Virtual Object emulates. Quick Test emulates the user's action on the virtual object during the run session. suppose you want to record a test on a Web page containing a bitmap that the user clicks. To enable Quick Test to click at the required coordinates during a run session. For example.73 - Arcus Infotech (P) Ltd . Virtual Objects: Your application may contain objects that behave like standard objects but are not recognized by Quick Test. which includes those coordinates. and each area opens a different destination page. The bitmap contains several different hyperlink areas. quick test stores the virtual object in the object repository for the test. In the test results. You can define these objects as virtual objects and map them to standard classes. Quick test stores this information in Virtual Object Manager. When you run a test. you can define a virtual object for an area of the bitmap. and map it to the button class. When you record a test. .Software Testing Automation (QTP) ________________________________________________________________________ 25.

specify a name for the Virtual object and collection in the Name and Collection Name fields. Use the cross-hairs symbol to mark the area for the virtual object. respectively. Step 7: Select the Yes option if you want to create more virtual objects.74 - Arcus Infotech (P) Ltd . The cross-hairs symbol appears. . and click Next. and click Next. select the Parent Only option or the Entire Parent Hierarchy option. and click Finish. Ensure that the object areas for multiple Virtual objects do not overlap. Step 5: In the Identify Object Using section. Step 3: Click Mark Object Button. Otherwise. From the Class list. click Next. Step 8: Now use Record option to generate the Script and see the Result. select No. The Object Configuration page appears. Step 6: In the Save Virtual Object page that appears. select Tools>Virtual Objects> New Virtual Object to open the Welcome to The Virtual Object Wizard page. Step 2: Click Next.Software Testing Automation (QTP) ________________________________________________________________________ Quick test does not recognize virtual objects during analog recording or Low-Level Recording. select the class (Object) to which you want to map the Virtual object. You cannot use the Object Spy feature to Recognize Virtual Objects. Step 4: On the Mark Virtual Object page. The Map To a Standard Class page appears. The Mark Virtual Object page appears. To create a Virtual Object: Step 1: On the Quick test Professional menu bar.

For Example. select Tools>Virtual Objects>Virtual Object Manager. you can create virtual objects for the various buttons in the Paint toolbar and store them in a named Virtual object collection called paint. . To open Virtual Object Manager.Software Testing Automation (QTP) ________________________________________________________________________ 26. Step 1: From the Quick Test Professional menu bar. Virtual Object Collection: You store similar virtual objects in a named Virtual Object collection.75 - Arcus Infotech (P) Ltd . You use Virtual Object Manager to view the information about Virtual object collections.

you can add steps that perform operations using the following criteria.  Step Documentation: Display current Step. To display the Step Generator: Step 1: From the Quick Test Menu bar. Select Insert>Step Generator (or) Press F7. Utility Objects: Display predefined list of utility objects.  Arguments: Specifies a value set for an argument. Step Generator dialog box appears.  Category: Specifies an object or functions that the step performs. information about the available options based on the 27.1. Using the Step Generator dialog box.Software Testing Automation (QTP) ________________________________________________________________________ 27. Library and Local script functions.  Operation: Specifies category selected. Functions: Display all the functions including Build-in. Test Objects: . The argument may be optional depending on the object and operation being used. The options available in the Category list are: • • • Test Objects: Display contents of Object Repository. Step Generator: The step Generator enables you to add steps to a test by selecting from a range of context-sensitive options.76 - Arcus Infotech (P) Ltd .

Step 7: Now script is inserted in the QTP. click on OK. it shows Hand Symbol. Like this just Insert Lot of Scripts. Click on Ok.77 - Arcus Infotech (P) Ltd . Enter the Value in the Argument field. Step 3: Select Object for Step dialog box appears. .Software Testing Automation (QTP) ________________________________________________________________________ Step 2: In Category field Select Test Objects. Step 5: Object Selection dialog box appears. Step 3: In Object field click on Browse button. Step 4: After clicking Hand Button. click on the applications element which you want to Insert. Click on Hand Symbol at the Bottom left of the dialog box. Step 6: Now that captured value is added to the Step Generator.

Utility Objects: Step 8: Open the Step Generator Same like Step 1. E.g. 27. Step 13: Click OK to insert the Script.Software Testing Automation (QTP) ________________________________________________________________________ 27.g. Step 10: In Object field select the Utility. Step 9: In the Category field Select Utility Object. it is used to insert the System utility Scripts.2. Step 14: Do the Same steps to Insert the remaining Scripts. Functions: .: Path of the application.: Systemutil Step 11: In Operation Field Defaultly it select after selecting values in the Object field.3.78 - Arcus Infotech (P) Ltd . E. Step 12: Enter the values in the Argument field.

: Inbox to insert the Inbox Function.79 - Arcus Infotech (P) Ltd .Software Testing Automation (QTP) ________________________________________________________________________ Step 15: Open the Step Generator Same like Step 1. it is used to insert the Functions. Eg: All.g. Step 16: In the Category field Select Functions. Step 11: In Operation Field select operation for the particular function. Step 13: Click OK to insert the Script. Step 14: Do the Same steps to Insert the remaining Functions. . Step 10: In Library field select the Library. Step 12: Enter the values in the Argument field. E.

you can insert the definition in your function library and associate it with your test. The Function Definition . or you can insert the definition directly in a test script in the Expert View. if needed.) This is because the Function Definition Generator inserts the function in the currently active document after you finish defining it. Step 2: we need to open new Function Library Page to insert the Function Syntax and to execute the Function. which enables you to generate definitions for new user-defined functions and add header information to them. . You can then register these functions to a test object. Step 3: Choose Insert > Function Definition Generator or click the Function Definition Generator button Generator opens.80 - Arcus Infotech (P) Ltd . You fill in the required information and the Function Definition Generator creates the basic function definition for you. Finally. (You can click the document's tab to bring it into focus.Software Testing Automation (QTP) ________________________________________________________________________ 28. you complete the function by adding its content (code). Function Definition Generator: Quick Test provides a Function Definition Generator. To open Function Definition Generator: Step 1: Make sure that the function library or test in which you want to insert the function definition is the active document. After you define the function definition.

or component whose application area is associated with this function library). according to whether you want to define a function or a subroutine.Software Testing Automation (QTP) ________________________________________________________________________ Step 4: In the Name box.81 - Arcus Infotech (P) Ltd . The name should clearly indicate what the operation does so that it can be easily selected from the Step Generator Step 5: From the Type list. enter a name for the new function. Step 6: From the Scope list. choose the scope of the function—either Public (to enable the function to be called by any test. choose Function or Sub. or Private (to enable the function to be called only from elsewhere in the .

the scope is set to Public. Step 7: In Preview Screen we can able to see the Functions. . add a synchronization point.) Note: If you create a user-defined function manually and do not define the scope as Public or Private. by default. Quicktest waits for an object to achieve a specific status or for the timeout of the object synchronization to occur before moving on to the next step. Step 8: Click on OK to insert the Syntax. Quick test Professional displays an error message if it proceeds to the next step before completing the previous steps. 29. This timeout indicates that during text execution. Quick Test Professional has a default global synchronization timeout. Synchronization Point: Synchronization is used to instruct Quick Test to wait for the application process to complete before proceeding to the next step in the test.1. (Only public functions can be registered to a test object.82 - Arcus Infotech (P) Ltd . By default. it will be treated as a public function. Add a Synchronization Point While Recording: A Synchronization Point must be inserted while recording. If a process takes considerably longer to complete. the global synchronization timeout may not sufficient for the step to complete and the next step might fail. 29. To give these longer steps in a test enough time to complete.Software Testing Automation (QTP) ________________________________________________________________________ same function library).

83 - Arcus Infotech (P) Ltd . Step 6: in the Timeout field. select the property name and in the Property Value field. Step 4: Click OK. Parameterize through Data Driver Wizard. type the synchronization point timeout in milliseconds. type the property value for which Quick Test should wait before moving to the next step. Step 5: From the Property Name list. This time will be added to the global timeout.Software Testing Automation (QTP) ________________________________________________________________________ To add a Synchronization Point: Step 1: Click on Record Button.: wait (5).g. . The Add Synchronization Point dialog box appears. Note: we can insert the Synchronization point manually by wait (time). Parameterization: We can parameterize the value by two methods 1. E. 30. The Object Selection-Synchronization Point dialog box appears. Step 3: Use the pointing hand cursor to select the object in the Flight Reservation window for which you want to add the Synchronization point. Step 2: From the Quick Test Professional menu bar. The cursor changes to a pointing Hand. Click Ok. Parameterize through the Keyword View. 2. select Insert>Synchronization Point.

Parameterize Through Data Driver Wizard: The Data Driver enables you to quickly parameterize several (or all) property values for test objects.84 - Arcus Infotech (P) Ltd . . and/or method arguments containing the same constant value within a given action. (Or) Data Driver Wizard is used to convert the Templates and it’s Input from the Script to the Data table (Designed Time Data Table). To parameterize a value using the Data Driver: Step 1: Generate the Script by Using the Record Button for Particular application. checkpoints.Software Testing Automation (QTP) ________________________________________________________________________ 30. Step 2: Choose Tools > Data Driver. Quick Test scans the test for constants before the Data Driver opens (this may take a few moments).1.

85 - Arcus Infotech (P) Ltd . The Add Value dialog box opens. Step 4: Select the value you want to parameterize from the Constants list and click Parameterize. The Data Driver Wizard opens. You can choose whether to wait for the constants to load. click Add Value. Enter a constant value in the dialog box and click Add.Software Testing Automation (QTP) ________________________________________________________________________ Note: If the action being scanned contains a large number of lines and constant values. Quick Test warns you that loading the constants may take some time. For each constant value. . Step 3: If you want to parameterize a value that is not currently displayed in the list (such as an object property value). The Data Driver displays the Constants list for the action. it displays the number of times the constant value appears in the action. Note: You can add only constant values that currently exist in the test action. The constant is added to the list. or to open the Data Driver wizard quickly without constants.

which parameterization options you want to use. The Parameterize the Selected Step screen opens. For each step. You set your parameterization preferences one time and the same options are applied to all occurrences of the value.Software Testing Automation (QTP) ________________________________________________________________________ Step 5: Select the type of parameterization you want to perform: Step-by-step parameterization. Step 6: If you selected Step-by-step parameterization. Enables you to view the current values of each step containing the selected value. click Next. .86 - Arcus Infotech (P) Ltd . Parameterize all. you can choose whether or not to parameterize the value and if so. Enables you to parameterize all occurrences of the selected value throughout the action.

Step 12: Do the same step to insert the new datas. Alternatively. When you test your applications. Step 10: In Location in the Data Table select the Global Sheet or Current action sheet (local) to insert the data. Step 13: Through the data table (Designed Time Data table) apply the multiple no of Inputs. each with its own set of data. Step 11: Click Next. and Click on Finish to insert the data. Step 7: Data Driver Wizard-Parameterize the Selected Step dialog box appears. suppose you want to check how your Web site responds to ten separate sets of data. you may want to check how the application performs the same operations with multiple sets of data. Step 9: Parameter Option dialog box appears. 30. the Parameter option is enabled in the Configure value area.Software Testing Automation (QTP) ________________________________________________________________________ If you selected Parameterize all. For example. Select your parameterization preferences the same way that you would for an individual step. You could record ten separate tests. Step 8: Select Parameter Radio button and click on browse button (Parameter option). and click on Ok. you can create Data Table parameters so that .87 - Arcus Infotech (P) Ltd . Step 14: Execute the script to check the Result. in the Name field enter the Template Name. Parameterizing through the Keyword View.2.

31.88 - Arcus Infotech (P) Ltd . Object Identification: .Software Testing Automation (QTP) ________________________________________________________________________ your test runs ten times. Step 9: Enter the Multiple number of inputs through the data table for the Particular Script. select the Input (that you want to parameterize) in the value field. Step 5: In Value Configuration Option dialog box select Name field and modify the name which you want enter as a template in the Data Table. Step 7: Click on Ok to insert the selected value in the Selected Data Table. this way of setting parameters is called parameterization. Step 6: In the Location in Data Table select the Data Table you want to insert (Global Sheet and Current Action Sheet (local)). Step 2: open the keyword view. just click on it to open the Value Configuration options. Step 8: Do the same step to apply for more no of Templates. Step 4: In the Value Configuration Options just select the Parameter Radio Button. each time using a different set of data. Step 3: Now it shows parameter option button. Step 1: Enter the Script for the particular application.

For Example. Step 2: Object Identification dialog box appears. In the Object Identification dialog box. the flight Reservation application uses the Fly From and Fly To Combo box. Reset the properties of an object class. Select the ordinal identifier for an object class. To open the Object Identification dialog box: Step 1: From the Quick test professional menu bar.1. 31. Quick test Professional assigns a set of mandatory and assistive properties to the Wincombobox object class to help the class recognize . which are objects of the WinComboBox object class. from the Test Object Classes list. Quick test has a predefined set of properties that it learns for each test object. select Tools>Object Identification.89 - Arcus Infotech (P) Ltd . Modify the mandatory and assistive properties of an object class. 31. select the object class whose properties you want to view. You use the object Identification dialog box to view and modify the predefined set of properties of all object classes. Create a user-Defined object class. Identifying Types of Object Class Properties: An application uses multiple instances of an object class.Software Testing Automation (QTP) ________________________________________________________________________ You can view and modify the object class properties in the Object Identification dialog box.2. Use the Object Identification dialog box to: • • • • • View the mandatory and assistive properties of an object class.

Mandatory properties are the properties that Quick Test always recognizes for a test object class.Software Testing Automation (QTP) ________________________________________________________________________ the combo box. Step 4: in the Add/Remove Properties dialog box. Quick Test recognizes assistice properties if the mandatory properties are not sufficient to create description for an object in an object class. Step 7: Click on Ok to close the Add/Remove Properties dialog box and apply the new properties to the object class. click New to create a new property. type a name for the property. Step 5: If the available property are not sufficient.90 - Arcus Infotech (P) Ltd . the Attached Text property uniquely identifies the object of the Win Combo box object class. Quick test assigns additional mandatory and assistive properties to create a unique description of an object. there may be instances of applications where the attached text may be the same for different combo box. click Add/Remove. Step 3: In the Object Identification dialog box. Therefore. and click Ok. . clear the properties that you do not require and check the properties that you require. In the flight Reservation application. below the Mandatory Properties list. in the New Property Name field. In such case. Quick Test assigns the Attached Text property as a mandatory property to the Win Combo box object class. However. Step 6: In the Name Property dialog box. These properties help create a unique description of each object in an object class.

BY default. Note: when you run a test. Quick Test uses the Smart Identification feature to identify the object. Step 8: Quick test uses an Ordinal Identifier to identify an object if the mandatory and assistive properties are insufficient to identify the object. 31.91 - Arcus Infotech (P) Ltd . 32. or if it finds multiple objects that match. Step 11: Click on Ok in the Object Identification dialog box. Step 12: After you modify the Smart Identification properties and update a test. The Smart Identification Properties-Browser dialog box displays the Base Filter Properties and Optional Filter Properties lists for an object class. The Smart Identification Properties-Browser dialog box appears. Quick Test searches for an object based on the description it learned for the object. Step 10: Click Add/Remove to modify a property. Breakpoint: . click Configure.Software Testing Automation (QTP) ________________________________________________________________________ Note: You can modify the assistive properties of an object class in a similar manner. the location of an object is used as an ordinal identifier to identify an object. If Quick test cannot find any object that matches the description. you run the test and view the test result.3. You select the Ordinal Identifier as Location Or Index from the Ordinal Identifier list in the Object Identification dialog box. To modify the Smart Identification Properties: Step 9: In the Object Identification dialog box.

you can remove breakpoints from your test or library function. You insert a breakpoint in the Keyword View by clicking in the left margin at the point where you want to insert the breakpoint. After you finish you breakpoints. Suspend a run session and inspect the state of your application. 32. You can • • • • • Examine the effects of the run up to the breakpoint. or by selecting a step and pressing F9. Make a point which to begin stepping through a test or function library using the step commands.Software Testing Automation (QTP) ________________________________________________________________________ Breakpoint instruct Quick test to pause a run session at a predetermined place in a test or function library and quick test pauses the run (a breakpoint) before executing the step. Continue running the test or function library from the breakpoint. You can set breakpoints. or choosing . Make any necessary changes.1. Breakpoints are applicable only to the current Quick test session and are not saved with your test or function library. Insert Breakpoint/Remove Breakpoint: You can easily insert and remove breakpoints in the Keyword View. You can temporarily enable and disable breakpoints. it is also displayed in the Expert View. and vice versa. When you place a breakpoint in a step in the Keyword View.92 - Arcus Infotech (P) Ltd .

ActionName which are . a. Step 4: You can remove a breakpoint by clicking the breakpoint icon. Debug > Insert/Remove Breakpoint. Build-In Variables: Build-in variables are the name suggests are predefined by QTP. Types of Environmental Variable: • • • User-Defined Internal. 33.93 Arcus Infotech (P) Ltd . Built-in. Step 5: Execute the Script to see the Result. Step 2: Debug > Insert/Remove Breakpoint. 33. Examples of such variables are OS. Random Numbers. Environment Variable.Software Testing Automation (QTP) ________________________________________________________________________ Step 1: Generate the Script for the Application. User-Defined External. Step 3: Red breakpoint icon is displayed. OS Version. Environmental Variable: When we want to use the same variable in different actions then we can use envionment variables we can load the set of environment variables from a XML file directly 33. or by selecting a step and pressing F9 or choosing.1. Data Driven Testing: • • • Data table Method.1.1.

User Defined Internal: User Defined Internal variables are the variables defined by you ( the user) within the test and which are saved within the test and also accessible from within the test.94 - Arcus Infotech (P) Ltd . Step 5: Now close the Test Settings window and go to test. a Test Settings window opens. Step 2: Go to the File (Menu)>Settings. respectively. Step 1: Open a new test. . Step 3: Go to the Environment Tab. Step 2: Go to File menu> Settings. b. a Test settings window opens. By default Built-in variable type is selected and you will be able to see Name and Description of the Build-in variables below variable type Dropdown box. Step 4: You can click on any of those variables to see their current value.Software Testing Automation (QTP) ________________________________________________________________________ for Operating System. Step 1: Open a new test. Operating System Version and Name of the action which is currently running. Step 6: In the Expert view type: a=Environment (“actionname”) & “is running on” & environment (“OS”) msgbox (a) Step 7: Run the Test.

It will add the variable with its type as ‘internal’. Step 5:’Add New Environment Parameter’ window opens up.g.WinButton ("Cancel").g. Step 7: Open the Test in QTP. in Name type ‘Agentname’ and in Value type ‘arcus’ (without quotes.95 - Arcus Infotech (P) Ltd .Set lv_agentname Dialog ("Login"). Step 4: Click on the ‘+’ which is on the right of Variable Type dropdown. User Defined External: User Defined External Avriables are the variables which are defined in the file outside of test.Run"C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a. Step 6: Click Apply and OK to come out of the Test Settings window. These act as read only for the test.Click Step 8: Execute the Script and analyse the Result. and Enter the script as E. You can . I have added quotes just for clarity) and click on OK. From Variable Type dropdown select User.WinEdit ("Agent Name :") . c.: lv_agentname=Environment.Software Testing Automation (QTP) ________________________________________________________________________ Step 3: Go the Environment Tab. type the Name and Value of the Variable e.exe" Dialog ("Login").Set lv_password Dialog ("Login").Value ("password") systemutil.Defined.WinEdit ("Password :") .Value ("agentname") lv_password=Environment.

Step 7: Click on Apply and Ok to come out of it. .xml file.Software Testing Automation (QTP) ________________________________________________________________________ create as many files for environment variables as you want and choose them for your test. Step 2: Enter the Value as <Environment> <Variable> <Name>Agentname</Name> <Value>arcus</Value> </Variable> </Environment> And save this notepad as . Step 1: Open a new NotePad . As soon as it is imported the complete path of that file will be shown in the File text box and the variables in it will show under Name. Value and Type heading (in our case it will show Agentname under Name. Step 6: Click on “load Variables and values from external file “ check box and import the external xml file that we created above. Step 4: Go to File menu> Settings. Step 3: Open the New Test in the QTP. and External under Type). a Test Settings window opens.96 - Arcus Infotech (P) Ltd . Step 5: Go the Environment Tab. From Variable Type dropdown select User.Defined. arcus under Value.

2. There are two types of Data Table Testing. Step 2: Go to the Keyword View and Parameterize the Templates and Its Values to the Defined Time Datatable.WinEdit("Agent Name:"). External Data Table Testing.WinEdit("Password:").97 - Arcus Infotech (P) Ltd . • • Internal Data Table Testing. Data Table Method: By using the Data Table method we are Checking the Functionality for the application with Multiple number of inputs.Value ("agentname") lv_password=Environment.Click Step 9: Execute the Script and Analyze the Result.Value ("password") systemutil.Run"C:\Program Files\Mercury Professional\samples\flight\app\flight4a. a.WinButton("Cancel"). Internal Data Table Testing: It is nothing but just applying the multiple number of inputs through the Defined Time Data Table in the Qtp. and type Script as Environment. Step 1: Enter all the Scripts for the Application in the Expert View. 33.exe" Interactive\QuickTest dialog("Login").Set lv_password dialog("Login"). .LoadFromFile”Enter the path of the Xml file you saved” lv_agentname=Environment.Software Testing Automation (QTP) ________________________________________________________________________ Step 8: Open the test in the QTP.Set lv_agentname dialog("Login").

"Arcus" rc=datatable. e. b. Excel Sheet.g.WinButton (“Cancel”).click .WinEdit("Password:"). External Data Table Testing: It is nothing but just applying the multiple number of inputs through the External File i. Step 4: Execute the Script to analyse the Result.WinEdit("AgentName:").: datatable.GetSheet("Arcus")."Name of the Sheet in Excel". Step 2: Save the Excel Sheet as .Value("password". and enter the Templates and its Value that you want to check the functionality of the application.xls.SetCurrentRow (i) dialog("Login").98 - Arcus Infotech (P) Ltd . Step 4: Enter the Script as E."roles ") dialog("Login").e.ImportSheet"path".AddSheet"Arcus" datatable. and Password and its value. Step 1: Open the Excel sheet."roles") Dialog (“Login”).getrowcount msgbox rc For i=1 to rc datatable.g.Setdatatable.Setdatatable. Step 3: Open the Test in the QTP. agentname and its value.Software Testing Automation (QTP) ________________________________________________________________________ Step 3: Through the Defined Time Data Table just apply the Multiple No of Inputs.Value("agentname".

MS-Access: By using MS-Access we are applying the multiple no of Inputs to check the functionality.Command: we can use this class to execute any SQL statement like Insert. SQL Server. 1. 2.1. 3.99 - Arcus Infotech (P) Ltd .Recordset: we can use this class to select the record from database. By using Database connection we are applying the Multiple no of inputs to the Script. We can apply the input by 3 ways.Connection: we can use this class to establish the connection to the database.Software Testing Automation (QTP) ________________________________________________________________________ Next Step 5: Execute the Script two analyze the Result. Oracle. 34. . • • • MS-Access. Database Connections: We can connect to database & update data & Read data from database using Below Classes. Adobd. Adodb. 34. Update and delete Commands. Adobd.

and close the Database. Step 5: Database (Access 2000 file format ) dialog box opens.open "provider=microsoft. Step 7: Now Data Table opens.open"select * from orders".jet.WinEdit ("Agent Name :") .recordset") con.Set rs ("agent name") . Step 8: Then Enter the multiple number of inputs in the Table. Step 4: File New Database dialog box opens.100 - Arcus Infotech (P) Ltd .EOF<>true Dialog ("Login"). data source="" rs. Step 9: Save the Table.g. Step 3: Select Blank Database at Right side of the MS-Access. in the File Name field just enter the Database Name and click on Create. Step 11: Enter the script as E.oledb. con While rs.4. Step 6: In that dialog box Double click on Create table by Entering Data to create a new data table in the database. Step 10: Open the Test in the QTP.Software Testing Automation (QTP) ________________________________________________________________________ Step 1: Open the MS-Access.: Set con=createobject ("adodb.0.connection") Set rs=createobject ("adodb. In the Field Row just Enter the Template name e.g. Step 2: Create the Database by clicking on the New Button option in the Menu Bar. AgentName and Password.

g. Step 3: Enter all the Templates and Inputs in the Data table.Software Testing Automation (QTP) ________________________________________________________________________ Dialog ("Login"). Step 2: Create the Database and Create the Data table.EOF<>true Dialog ("Login"). con While rs.WinEdit ("Password :") . server= . 34.Set rs ("agent name") Dialog ("Login"). database= " .open"select * from orders".open"provider=sqloledb.WinEdit ("Agent Name :") .: Set con=createobject ("adodb.WinEdit ("Password :") .recordset") con.Set rs ("password") rs. pwd= .2.connection") Set rs=createobject ("adodb. uid= rs.101 - Arcus Infotech (P) Ltd .movenext . Step 5: Enter the Script as E. Step 1: Open the SQL Server.1.movenext Wend Step 12: Execute the Script to Analyse the Result. Step 4: Open the Test in QTP. SQL Server: Through the SQL Server we are applying the multiple no of inputs for the application.Set rs ("password") rs.

Step 4: Open the Test in QTP.movenext wend . Step 5: Enter the Script as E.1.102 - Arcus Infotech (P) Ltd .Set rs ("password") rs.g. server= . con While rs. Step 1: Open the Oracle Step 2: Create the Database and Create the Data table. database= " .EOF<>true Dialog ("Login").open"select * from orders".Set rs ("agent name") Dialog ("Login").WinEdit ("Agent Name :") .recordset") con. uid= rs.open"provider=oraoledb. Step 3: Enter all the Templates and Inputs in the Data table. Oracle: Through the Oracle applying the multiple no of inputs for the application.Software Testing Automation (QTP) ________________________________________________________________________ Wend Step 6: Execute the Script to analyse the Result.3.WinEdit ("Password :") .: Set con=createobject ("adodb.connection") Set rs=createobject ("adodb. 34. pwd= .

: Set fso=createobject ("scripting. Step 3: Open the Test in Qtp. Descriptive Programming: ." ") Dialog ("Login"). Step 1: Open the Notepad.txt. Flat Files: It is another method to apply the multiple no of inputs to the Script through the Notepad. 36.103 - Arcus Infotech (P) Ltd .opentextfile (" ".filesystemobject") Set f=fso.readline arr=split (s.WinEdit ("Agent Name :") .g.skipline While f.Set arr (0) Dialog ("Login"). Step 4: Enter the Script as E.Set arr (1) Wend Step 5: Execute the Script to analyze the Result. and Enter all the Templates and Inputs for the Templates that you want to apply the input for Script. 35. Step 2: Save the notepad as .WinEdit ("Password :") .Software Testing Automation (QTP) ________________________________________________________________________ Step 6: Execute the Script to analyse the Result.atendofline<>true s=f. 1) f.

winbutton(“text:=OK”). So one of the other advantage is you can copy this script and run this from any other machine (other that on which it was created) and it is supposed to work fine. 36.Software Testing Automation (QTP) ________________________________________________________________________ It is nothing but a technique using which operations can be performed on the AUT object.g: Dialog(“text:=Login”). Static Descriptive Programming. 36.2.winedit(“attached text:=Password:”). Step 3: Identify the properties for the applications option by using Object Spy. directly.1. 1. Step 2: Open the application that you want to write the Script. which describes the object. Step 1: Open the Test in the Qtp. Step 4: Enter the script as.winedit(“attached text:=Agent Name:”).set “Arcus” Dialog(“text:=Login”).104 - Arcus Infotech (P) Ltd .set ”mercury” Dialog(“text:=Login”). Which are not present in the Object Repository. Dynamic Descriptive Programming: . Static Descriptive Programming: We provide the set of properties and values. 2. E. Dynamic Descriptive Programming.click Step 5: Execute the script to analyse the Result. There are two Types of Descriptive Programming. this below Example uses Descriptive Programming to open Flight Application and does not use object Repository at all.

Software Testing Automation (QTP) ________________________________________________________________________ Step 1: Open the test in QTP. Step 3: Identify the properties for the applications option by using Object Spy.set”Arcus” Dialog(dianame). This below Example uses Descriptive Programming to open Flight Application and does not use object Repository at all.set”mercury” Dialog(dianame). Keyword Driven Testing: Step 1: Open the Excel sheet and modify the Sheet 1 as Module.create Pwd(“attached text”).105 - Arcus Infotech (P) Ltd .winedit(agname). .winedit(pwd). create But(“text”).value=”Agent Name:” Set pwd=Description. 37. Step 5: Enter the Script as Set dianame=Description.click Step 6: Execute the Script and analyze the Result.winbutton(but). Sheet 2 as Test Case and Sheet 3 as Test Step.value=”OK” Dialog(dianame).value=”Password:” Set but=Description. Step 2: open the application that you want to write the Script. Step 4: Enter the script as. create Dianame(“text”).create Agname(“attached text”). So one of the other advantage is you can copy this script and run this from any other machine (other that on which it was created) and it is supposed to work fine.value=”Login” Set agname=Description.

Value("moduleid"."module1" datatable. Keyword. and Testcaseid and enter value in all the Templates.GetSheet("module1").xls.AddSheet"module1" datatable."teststep1" mcount=DataTable. Step 7: Enter the Script as E. Testcasedescription."testcase1" datatable.Value("moduleexecution". Testcaseexecution. Modulename and Moduleexecution and enter all the values in the Step 3: In the Test Case sheet enter the Template as Testcaseid.AddSheet"testcase1" datatable.SetCurrentRow(i) mexec=DataTable."teststep".xls".getrowcount For i=1 to mcount DataTable. Step 5: Save the Excel sheet as .ImportSheet"C:\Documents and infotech\Desktop\key. Module sheet enter the Template as Moduleid.xls". Step 6: Open the Test in the Qtp.xls"."module1") Settings\arcus Settings\arcus Settings\arcus .AddSheet"teststep1" datatable.ImportSheet"C:\Documents and infotech\Desktop\key. Functionname.Software Testing Automation (QTP) ________________________________________________________________________ Step 2: In templates."module1") If mexec="Y" Then modid=DataTable. Step 4: In Test Step sheet enter the Templates as Teststepid. and Moduleid and enter all the values in the templates."testcase".106 - Arcus Infotech (P) Ltd .g: Nextdatatable."module".ImportSheet"C:\Documents and infotech\Desktop\key.

"testcase1") If modid1=modid and tcexec="Y" Then tcid=DataTable.Value("testcaseid".Value("testcaseid".SetCurrentRow(k) tcid1=DataTable.getrowcount For j=1 to tccount DataTable."teststep1") MsgBox keyword Select Case keyword Case "la" Call la Case "lo" Call lo Case "clo" Call clo Case "la1" Call la1 Case "lo1" Call lo1 Case "fr" Call fr Case "capp" Call capp End Select End if Next End If Next End If Step 8: Create a New Function Library Page by using File>New>Function Library.Value("keyword".GetSheet("testcase1").getrowcount For k=1 to tscount DataTable."testcase1") modid1=DataTable.Value("testcaseexecution".Software Testing Automation (QTP) ________________________________________________________________________ MsgBox modid tccount=DataTable. Step 9: Shortkut Key to open Library page is Shift+Alt+N.107 - Arcus Infotech (P) Ltd . Step 10: In the Library page Enter the Function Syntax and its Script like this."teststep1") If tcid1=tcid then keyword=DataTable. .GetSheet("teststep1")."testcas MsgBox tcid tscount=DataTable.Value("moduleid".SetCurrentRow(j) tcexec=DataTable.

Set "sdfgsdfg" Dialog("Login").Close End Function Step 11: Save the Function Library Page.Select "Frankfurt" Window("Flight Reservation").Click End Function Function capp Window("Flight Reservation").SetSecure "4ae135406e68f334ebd94cbccf67f62f249df683" End Function Function clo Dialog("Login").Dialog("Flights Table").ActiveX("MaskEdBox").WinEdit("Password:").Select "Paris" Window("Flight Reservation").WinEdit("Agent Name:").SetSecure "4ae135406e68f334ebd94cbccf67f62f249df683" Dialog("Login").Type "111111" Window("Flight Reservation").Run "C:\Program Files\Mercury Professional\samples\flight\app\flight4a.Click End Function Function la1 SystemUtil.WinEdit("Agent Name:").Click Window("Flight Reservation").WinButton("Cancel").WinEdit("Password:").108 - Arcus Infotech (P) Ltd .Run "C:\Program Files\Mercury Professional\samples\flight\app\flight4a.Software Testing Automation (QTP) ________________________________________________________________________ E.Click Window("Flight Reservation").WinComboBox("Fly From:").exe" End Function Interactive\QuickTest Function lo Dialog("Login").Set "sdfgsdfg" Dialog("Login").Set "fsdgsdfgs" Window("Flight Reservation").g: Function la SystemUtil.exe" End Function Function lo1 Dialog("Login").WinButton("OK").WinComboBox("Fly To:").Click End Function Function fr Window("Flight Reservation"). Interactive\QuickTest .WinEdit("Name:").WinButton("FLIGHT").WinButton("Insert Order").WinButton("OK").

Step 14: After the browsing the library file click on Ok.Software Testing Automation (QTP) ________________________________________________________________________ Step 12: Now we want to link the Function Library Page with the Test Page in the Qtp by File>Settings>Resources. Step 13: Test Settings dialog box appears. Click on + symbol to browse the Saved Library file.109 - Arcus Infotech (P) Ltd . . Step 15: Execute the Script to analyse the Result.

Sign up to vote on this title
UsefulNot useful