Monday, November 30, 2009

27. Step Generator:

The step Generator enables you to add steps to a test by selecting from a range of context-sensitive options. Using the Step Generator dialog box, you can add steps that perform operations using the following criteria.
ð Category: Specifies an object or functions that the step performs. The options available in the Category list are:
· Test Objects: Display contents of Object Repository.
· Utility Objects: Display predefined list of utility objects.
· Functions: Display all the functions including Build-in, Library and Local script functions.
ð Operation: Specifies available options based on the category selected.
ð Arguments: Specifies a value set for an argument. The argument may be optional depending on the object and operation being used.
ð Step Documentation: Display information about the current Step.

To display the Step Generator:
Step 1: From the Quick Test Menu bar, Select Insert>Step Generator (or) Press F7. Step Generator dialog box appears.

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

27.2. Utility Objects:
Step 9: Open the Step Generator Same like Step 1.
Step 10: In the Category field Select Utility Object, it is used to insert the System utility Scripts.
Step 11: In Object field select the Utility. E.g.: Systemutil
Step 12: In Operation Field Defaultly it select after selecting values in the Object field.
Step 13: Enter the values in the Argument field. E.g.: Path of the application.
Step 14: Click OK to insert the Script.
Step 15: Do the Same steps to Insert the remaining Scripts.


27.3. Functions:
Step 16: Open the Step Generator Same like Step 1.
Step 17: In the Category field Select Functions, it is used to insert the Functions.
Step 18: In Library field select the Library. Eg: All.
Step 19: In Operation Field select operation for the particular function. E.g.: Inbox to insert the Inbox Function.
Step 20: Enter the values in the Argument field.
Step 21: Click OK to insert the Script.
Step 22: Do the Same steps to Insert the remaining Functions.

26. Virtual Object Collection:


You store similar virtual objects in a named Virtual Object collection. For Example, you can create virtual objects for the various buttons in the Paint toolbar and store them in a named Virtual object collection called paint.
You use Virtual Object Manager to view the information about Virtual object collections. To open Virtual Object Manager.
Step 1: From the Quick Test Professional menu bar, select Tools>Virtual Objects>Virtual Object Manager.

25. Virtual Objects:

Your application may contain objects that behave like standard objects but are not recognized by Quick Test. You can define these objects as virtual objects and map them to standard classes, such as a button or a check box. Quick Test emulates the user's action on the virtual object during the run session. In the test results, the virtual object is displayed as though it is a standard class object.
For example, suppose you want to record a test on a Web page containing a bitmap that the user clicks. The bitmap contains several different hyperlink areas, and each area opens a different destination page. When you record a test, the Web site matches the coordinates of the click on the bitmap and opens the destination page.
To enable Quick Test to click at the required coordinates during a run session, you can define a virtual object for an area of the bitmap, which includes those coordinates, and map it to the button class. When you run a test, 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 stores this information in Virtual Object Manager.
When you record a test that uses a virtual object, quick test stores the virtual object in the object repository for the test. Quick test uses the information in the object repository to recognize the virtual object test playback.
Quick test does not recognize virtual objects during analog recording or Low-Level Recording. You cannot use the Object Spy feature to Recognize Virtual Objects.

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

24. Merge Object Repositories:


Two shared object repositories can be merged into a single object repository. This is done in the Object Repository Manager.
When you merge two shared object repository, the primary object repository and the Secondary object repository, a Third object repository called Target object Repository gets created. To merge two object repositories:

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


Sunday, November 29, 2009

23. Recovery Scenario Manager:

Identifying Exceptions:
Unexpected events during a test run disrupt a test or may give invalid test result. For example, during a test run, an application error may occur. This error does not permit the automated test to navigate to the feature, Screen, or Module that needs to be tested. These unexpected errors and events are called exception.
An exception could occur in the AUT or an exception could occur because sources are external to the AUT. For Example, an exception occurs if notification messages, such as you have mail or Printer out of Paper, appear during a test run.
Events that are expected to occur during a test run are not called exceptions. For Example, the message box that appears when you enter a bad password is an expected event. Similarly, the prompt to save changes or enter details in a mandatory field are expected events. You cannot classify these events as exceptions.
Introduction to a Recovery Scenario:
To successfully complete a test run, you need to identify the exceptions that can occur during a test run and take appropriate action to handle the exceptions.
You can create recovery scenarios in Quick Test Professional to handle exceptions that occur during a test run. A recovery scenario consists of the following components:
• Trigger: Specifies the exception that may occur during a run session. For Example, the test may be interrupted by an error pop-up window.
• Recovery: Instructs Quick Test how to handle the exception. For Example, you can instruct Quick Test to click a button on the error pop-up window to close the window.
Post-Recovery: Instructs Quick Test how to proceed after the recovery operations are performed. For Example, after an exception is handled; you may want Quick Test to restart a test from the beginning.
After you create a recovery scenario, you can associate it with one or more tests.

To create Recovery Scenario:
Step 1:
Enter invalid input in the application, and execute the Script. Now it shows the pop-up message.
Step 2: From the Quick Test Professional menu bar, select Resources>Recovery Scenario Manager. The Recovery Scenario Manager Dialog box appears.
Step 3: In the Scenario Section, click the New Scenario button to display Recovery Scenario Wizard.
Step 4: Click Next. The Select Trigger Event appears.

Note: In the first component of a Recovery Scenario, you identify the event type that can disrupt a test run.
To select a trigger Event type:
• Popup Window: if a popup window appears in an open application.
• Object State: If a mismatch occurs between the expected and the actual state of an object in the test.
• Test Run Error: If a step in the test fails.
• Application Crash: If an open application fails.

Step 5: Select Popup Trigger Event, click Next.

Note: After you select a trigger event type, you specify the conditions that can help Quick Test identify the correct event during a test run.

Step 7: On the Specify Pop-up Window Conditions page, click the Pointing hand button, and click the Pop-up error message box that you want the recovery scenario to handle.
Step 8: The Window Title and the Window Text Contains fields display the conditions to identify the Pop-up window.
Step 9: Click Next. The Recovery Operation Page appears.
Step 10: No need to enter anything now, click Next.

Note: After you specify the trigger event type and the trigger event conditions in Recovery Scenario Wizard, you specify the recovery operation(s) required to handle the trigger event. To identify the recovery operation.
Step 11: Select Keyboard or Mouse Operation, it performs a key press or a mouse click recovery operation.
Step 12: Select Next to select a recovery operation, such as Click Button with Label.
Step 13: Click on Hand Button to capture the buttons in the Pop-up error message.
Step 14: Now it captures the Ok button, click on Next.
Step 15: Click Next to Capture another button.
Step 16: Next>Keyboard or Mouse Operation>Next>Click Buttons with Label>Click on Hand button.
Step 17: Press Control Button to Deactivate the Capture and click on OK in the error pop-up message.
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.
Step 21: Click on Next.

Note: After you specify the recovery operation, identify the operation that you want to perform when the recovery operation complete.
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 on Next.

Note: After you identify a trigger event and select the recovery and Post-Recovery operations for a recovery scenario, you use the Name and Description page to provide a name and Description for the recovery scenario.
Step 23: In Scenario Name field enter the name for the Scenario you created and enter the Description in the Description field (Optional).
Step 24: Click on Next.
Step 25: The Completing The Recovery Scenario Wizard page displays the details of the recovery scenario in the Scenario Settings Section.
Step 26: To associate the recovery Scenario with the current test, check the Add Scenario to Current Test Check box.
Step 27: To save the recovery Scenario, Click Finish. The Recovery Scenario Manager Dialog box appears.

Note: After you create a recovery scenario, save the recovery scenario to a file.

Step 28: In Recovery Scenario Manager, click Save button to save the Scenario, and click Close to close the Recovery Scenario Manager.
Step 29: To add an existing recovery scenario to a test. From the Quick Test Professional Menu bar select File>Settings.
Step 30: In the Settings dialog box, click the Recovery tab.
Step 31: Defaultly the Saved Recovery will be available, if it not Available, click the Add button.
Step 32: Browse the Saved Recovery to the particular test. Click OK to apply the Scenario to the test.
Step 33: Execute the Script to Analyze the Result.

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.
Now we can share this captured action to any test.
If you plan to use shared objects in a test, you can create a shared object repository before you create the test. A Shared object repository can be used for multiple tests. Multiple shared object repositories can store shared objects.
You specify the shared object repositories that you want to use for an action in a test before you record a test. You can also create new shared object repositories and associate these repositories with an action in a test after you record the test.

To create and manage shared object Repositories
Step 1:
Open the Application that you want to Capture.
Step 2: Open the Object Repository Manager by Resources>Object Repository Manager.
Step 3: Object Repository Manager Dialog box appears.
Step 4: Select Object> Add Objects to add the objects to Repository Manager (or) click on Add Objects icon in Tool Bar.
Step 5: After Clicking Add Objects to Local it shows Hand Symbol, by using this Symbol click on the application (Which you want) to Capture the Objects.
Step 6: After Capturing Object Selection-Add to Repository dialog box appears, Click on OK.
Step 7: Define Object Filter dialog box appears, select All Object types Radio Button to capture all the objects in the Application for Recognition, Click on OK.
Step 8: Now in the Object Repository Manager dialog box captures all the objects from the application.
Step 9: Now Click on Save Button to save the Captured Objects in the Repository Manager.
Step 10: Now just close the Object Repository Manager.


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.
Note:
Now we want to recognize the saved Repository to write the Script. For Recognition purpose use Associate Repository.
Note:
You want to use Object Repository Manager compulsorily we want to Use Associate Repository for Recognition Purpose.

Step 11: To Open Associate Repository Resources>Associate Repository.
Step 12: Associate Repository dialog box appears.
Step 13: Click on Add Repository Button to open the saved Repository.
Step 14: Select the Action 1 in the Available Action Field and click on button to add the Action to Associate Actions, and then click on Ok to Recognize the Repository.
Step 15: Now Enter the Script in QTP.

Note:
Use the Object Repository Manager to manage all shared object repositories at one central location. In the Object Repository Manager you can:
Create a shared object Repository.
Associate Object Repositories to actions.
Add objects to a shared object repository.
Save a shared object Repository.
Modify an object in a shared object repository.

Saturday, November 28, 2009

21. Object Repository:

This Object Repository is also called as Local Repository. Because we can use the captured objects only for the particular test. We unable to share the captured objects to any other test.

When you create an action in a test, Quick test creates a new local object repository that store objects used in the action. This local object repository is the default type of object repository.

A local object repository stores objects associated with a specific action, so that only that action can access the stored objects.

When you record a test, Quick test automatically saves the information about the objects that you record in the local object repository. Quick test creates separate local object repositories for each new action.

Object Repository is used to Recognize each and every objects to QTP.

To use Object Repository:

Step 1: Open the Application that you want to Recognize.

Step 2: Select Resource menu>Object Repository.

Step 3: Object Repository-All Object Repository dialog box appears.

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.

Step 5: After Clicking Add Objects to Local it shows Hand Symbol, by using this Symbol click on the application (Which you want) to Recognize to the QTP.

Step 6: After Capturing Object Selection-Add to Repository dialog box appears, Click on OK.

Step 7: Define Object Filter dialog box appears, select All Object types Radio Button to capture all the objects in the Application for Recognition, Click on OK.

Step 8: Now in the Object Repository- All Object Repository dialog box captures all the objects for application.

Step 9: Close the Object Repository-All Object Repository dialog box.

Step 10: Now just enter the script in the test.

20. Object Spy:

Object spy is used to identify the applications objects properties.

(or)

Using the Object Spy pointing hand mechanism, you can view the supported properties and methods of any object in an open application. As you move the pointing hand over the objects in the application, their details are displayed in the Object Spy. These details may include the test object's hierarchy tree, its properties and values, and the methods associated with the object. For methods, the syntax is also displayed. In most environments, you can choose to view the test object properties and methods or the run-time (native) properties and methods.

In some environments, the test object is also highlighted in the application as you move the pointing hand over it. This enables you to visually distinguish between the various test objects in the application.

Step 1: Open your application to the page containing the object on which you want to spy.

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.

Step 3: Object Spy dialog box appears.

Step 4: Select the details you want to view for the object.

    • Click Run-time Object Properties or Test Object Properties.
    • To view the object's available methods and syntax, click the Methods tab. Otherwise, the Properties tab is displayed by default, enabling you to view the object's properties and their values.

Step 5: In the Object Spy dialog box, click the pointing hand.Quick Test is hidden. As you move the pointing hand over the test objects in your application, the test objects are highlighted, and you can view their test object properties or methods in the Object Spy dialog box. You can also view their parent objects in the object hierarchy tree area of the Object Spy dialog box.

Step 6: Highlight or click the object whose properties or methods you want to view. The Object Spy displays the object hierarchy tree and the properties or methods of the object that is selected within the tree.

Step 7: If you want to copy an object property or value, or a method's syntax to the Clipboard, click the property, value, or method to highlight it. The value is displayed in the selected property/value or method syntax box (located above the Description box). Highlight the text in 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.

19. Start Transaction and End Transaction:

It is used to find the execution time of enclosed VB script Statements. Each transaction name should have an associated Start Transaction and End Transaction. The Start Transaction statement must appear before the associated End Transaction. A transaction can be inserted anywhere in your test, but must start and end within the same action.

Inserting Start and End Transaction:

Step 1: Enter the Script in the test.

Step 2: Place the cursor at the required place in the test Script to enclose.

Step 3: Click on Insert>Start Transaction.

Step 4: Start Transaction dialog box appears.

Step 5: Then enter the start transaction Name. Eg: Login.

Step 6: Select Insert Statement as Before Current Step, Click on OK.

Step 7: Now Start Transaction Script will be inserted in front of the current step you selected.

Step 7: Click on Insert>End Transaction.

Step 8: End Transaction dialog box appears.

Step 9: Then Enter the End Transaction Name. Eg: Login.

Step 10: Select Insert Statement as After Current Step, click on OK.

Step 11: Now End Transaction Script will be inserted at the end of the current step you selected.

Step 12: Execute the script to Analyze the Result.

18. Split Action:

You can split an action that is stored with your test into two sibling actions or into parent-child nested actions. When you split an action, the second action starts with the step that is selected when you perform the split action operation.

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

When you split an action in your test that uses a local object repository:

  • Quick Test makes a copy of the local object repository.
  • The two actions have identical local object repositories containing all of the objects that were in the original local object repository.
  • If you add objects to one of the split actions, the new objects are added only to the corresponding local object repository.

To Split an Action:

Step 1: Enter the Script for the particular application.

Step 2: Insert the Cursor on the Particular line you want to split.

Step 3: Select Edit>Action>Split Action.

Step 4: The Split Action dialog box appears.

Step 5: In the Action Are Section, select one of the following options:

ð Independent of each Other: Creates two new independent actions.

ð Nested: Creates parent and child actions, where the last step in the parent action calls the child action.

Step 6: In the 1st Action Section, in the Name field, type a name for the first action.

Step 7: In the 2nd Action Section, in the Name field, type a name for the second action.

Step 8: Click OK to close the Split Action dialog box.

Step 9: Analyze the Result for Split Action.

17. Delete Action:

Delete action is to delete the Action from the test.

When you delete a reusable action from a test, the action is removed from the test flow list. The action’s local data sheet is also removed. The original action is not affected.

Step 1: Select the particular action you want to delete.

Step 2: Select Edit >Action>Delete Action.

Step 3:Particular Action will be Deleted.

16. Call to WinRunner:

When QuickTest links to WinRunner to run a test, it starts WinRunner, opens the test, and runs it. Information about the WinRunner test run is displayed in the QuickTest Test Results window.

You can insert a call to a WinRunner test using the Call to WinRunner Test dialog box or by entering a TSLTest.RunTestEx statement in the Expert View.

To insert a call to a WinRunner test using the Call to WinRunner Test dialog box:

Step 1: Choose Insert > Call to WinRunner > Test. The Call to WinRunner Test dialog box opens.

Step 2: In the Test path box, enter the path of the WinRunner test or browse to it.

Step 3: After opening the winrunner file, just select Close winrunner after running the test for closing the winrunner after executing the script it automatically closes the Win runner.

Step 4: Click on OK, to insert the Script in the QTP.

Step 5: Execute the Script to analyse the Result.

15. Call to Existing Action:

You can insert a call to a reusable action that is stored in your current test (local action), or in any other test (external action). Inserting a call to an existing action is similar to linking to it. You can view the steps of the action in the action view, but you cannot modify them. The called action's local object repository (if it has one) is also read-only. If you call an external action, you can choose, however, whether you want the data from the action's data sheet to be imported as a local, editable copy, or whether you want to use the (read-only) data from the original action.

To modify a called, external action, you must open the test with which the action is stored and make your modifications there. The modifications apply to all tests that call that action. If you chose to use the original action's data when you call an external action, then changes to the original action's data are applied as well.

To insert a call to an existing action:

Step 1: Choose Insert > Call to Existing Action, right-click an action icon and select Insert Call to Existing Action, or right-click any step and select Action > Insert Call to Existing. The Select Action dialog box opens.

Step 2: Use the From test browse button to find the test containing the action you want to copy. The Action box displays all local actions (actions that are stored with the test you selected).

Step 3: In the Action list, select the action you want to insert. When you select an action, its type (Non-reusable or Reusable Action) and description, if one exists, are displayed. This helps you identify the action you want to call.

Step 4: In location field select After the Current Step if it is Reusable action.

Step 5: Click on OK to copy the Action.

14. 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, the original action is copied in its entirety, including checkpoints, parameterization, the corresponding action tab in the Data Table, plus any defined action parameters. If the test you are copying has objects in the local object repository, the copied action's local object repository is also copied together with the action.

The action is inserted into the test as an independent, non-reusable action (even if the original action was reusable). Once the action is copied into your test, you can add to, delete from, or modify the action just as you would with any other non-reusable action. Any changes you make to this action after you insert it affect only this action, and changes you make to the original action do not affect the copied action.

Before applying call to copy of action we need to apply reusable action and save it.

To create a copy of an action and call the copy in your test:

Step 1: While recording or editing your test, choose Insert > Call to Copy of Action, right-click an action icon and select Insert Call to Copy of Action, or right-click any step and select Action > Insert Call to Copy. The Select Action dialog box opens.

Step 2: Use the From test browse button to find the test containing the action you want to copy. The Action box displays all local actions (actions that are stored with the test you selected).

Step 3: In the Action list, select the action you want to insert. When you select an action, its type (Non-reusable or Reusable Action) and description, if one exists, are displayed. This helps you identify the action you want to copy.

Step 4: Select Edit new action Properties Checkbox to modify the script after inserting.

Step 5: In location field select After the Current Step if it is Reusable action.

Step 6: Click on OK to copy the Action.

13. Reusable Action:

An action that can be called multiple times by the test with which it is stored (the local test), as well as by other tests.

Step 1: select the particular action in Action toolbar.

Step 2: Select Edit>Action>Action Properties.

Step 3: Action Properties dialog box opens, in this dialog box under General tab select Reusable Action Checkbox at the Bottom of the Left.

Step 4: Click on OK to apply the Reusable Action.

Note: you should make an action Reusable only after you record and enhance your tests completely. Other testers might start calling the action as soon as you make it reusable.

12. Rename Action:

To make your test easy to understand provide descriptive names to each action.

To modify an action name.

Step 1: Select Edit>Action>Rename Action.

Step 2: Another Method Shift+F3.

Step 3: Rename Action dialog box appears.

Step 4: Modify the name in the New Name, and click on OK.

After Renaming the actions name, all the actions will be arranged in the alphabetical order but during execution the QTP execute the Action (Script) which was created first.

11. 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.

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 . The Insert Call to New Action dialog box opens.

Step 2: Insert Call to New Action dialog box appears.

Step 3: In the Name Field, type the name of the Action.

Step 4: Choose the location of the new action.

Step 5: Click OK.

10. 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. These values can be used later in the different point in application.

10.1. Standard Output Value.

You can use standard output values to output the property values of most objects. For example, in a Web-based 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 could create an output value in your test to store the number of links on the page.

· You can use standard output values to output text strings by specifying the text property of the object as an output value.

10.2. Text Output Value & Text Area Output Value:

You can use text output values to output text strings displayed on a Web page or application. When creating a text output value, you can output a part of the object's text. You can also specify the text before and after the output text.

You can use text area output values to output text strings displayed within a defined area of a screen in a Windows application.

For example, 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. Inside the If statement, you check whether a window exists with a known title bar value, for example Error. If it exists, you output the text in this window (assuming that the window size is the same for all possible error messages).

10.3. Database Output Value:

You can use database output values to output the value of the contents of database cells, based on the results of a query (result set) that you define on a database. You can create output values from the entire contents of the result set, or from a part of it. During the run session, Quick test retrieves the current data from the database and outputs the values according to the settings that you specified.

10.4. XML Output Value (From Application) &

XML Output Value (From Resource).

You can use XML output values to output the values of XML elements and attributes in XML documents.

After the run session has finished, you can view summary results of the XML output values in the Test Results window. You can also view detailed results by opening the XML Output Value Results window.

For example, suppose that an XML document in a Web page contains a price list for new cars. You can output the price of a particular car by selecting the appropriate XML element value to output.

9. Checkpoints:

A checkpoint defines the observation on application build functionality to compare our expected value of manual case and the actual build value.

A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. This enables you to identify whether your Web site or application is functioning correctly.

We can use the following checkpoints in qtp automate the functionality checklists or coverage.

  • Standard checkpoint.
  • Text checkpoint.
  • Text area checkpoint.
  • Bitmap checkpoint.
  • Database checkpoint.
  • Accessibility checkpoint.
  • Xml Checkpoint (from application).
  • Xml checkpoint (from Resource).


9.1. Standard checkpoint:

Standard checkpoint checks the property value of an object in your application or web page. The standard checkpoint checks a variety of objects, such as buttons, radio buttons, combo boxes, lists, etc., for example, 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. We can use this checkpoint to verify the properties of objects, like as GUI checkpoint in winrunner.

Inserting Checkpoint:

We can insert the checkpoint to the application by two methods

Ø Inserting a checkpoint during Recording.

Ø Inserting a checkpoint after recording.


a. Inserting a checkpoint during recording:

Step 1: Click on Record Button in Automation Menu or Record button in Testing Toolbar.

Step 2: Open the particular application that you want to insert the checkpoint. (Window Based Application or Web Based Application).

Step 3: Open the Standard Checkpoint by Insert> Checkpoint> Standard Checkpoint. The cursor changes to a pointer hand.

Step 4: Now click on the applications object which you want to insert standard checkpoint. The Object Selection – Checkpoint Properties dialog box appears.

Step 5: In the Object Selection – Checkpoint Properties dialog box, click OK. The checkpoint Properties dialog box appears.

Step 6: Check the properties for which you want to add checkpoints and uncheck all other properties. The value of the property appears in the Constant field.

Step 7: Modify the value of the property (Expected Value), if required.

Step 8: Click on Ok to insert the Checkpoint.

Step 9: Execute the Script to verify the output in the Result window.

b. Inserting a checkpoint after recording:

To add a checkpoint after recording a test, you are Active Screen to select the fields for which you want to add checkpoints. If Active Screen is not active, click the Active Screen button.

To add a Standard checkpoint from Active Screen

Step 1: On Active Screen, right click the object for which you want to add checkpoint and select Insert Standard Checkpoint from the menu. The Object Selection-Checkpoint Properties dialog box appears.

Step 2: Click OK. The Checkpoint Properties dialog box appears.

Step 3: Check the properties for which you want to add checkpoints and uncheck all other properties. The value of the property appears in the Constant field.

Step 4: Modify the value of the property (Expected Value), if required.

Step 5: Click on Ok to insert the Checkpoint.

Step 6: Execute the Script to verify the output in the Result window.

9.2. Text Checkpoint:

Text Checkpoint checks that a text string is displayed in the appropriate place on a Web page or application. For example, suppose a Web page displays the sentence Flight departing from New York to San Francisco. You can create a text checkpoint that checks that the words “New York” are displayed between “Flight departing from” and “to San Francisco”. To validate the existence text is an object, we can use checkpoint. This checkpoint compares our expected value with corresponding object in four ways:

  • Match Case.
  • Exact Match.
  • Ignore Spaces.
  • Text not Displayed (allows blank space as valid)

You can add a text checkpoint while recording or editing steps in a Windows- or Web-based application.

a. To add a text checkpoint while recording:

Step 1: Click on Record button.

Step 2: Display the page, window, or screen containing the text you want to check.

Step 3: Choose Insert > Checkpoint > Text Checkpoint, or click the Insert Checkpoint or Output Value button and choose Text Checkpoint.

The QuickTest window is hidden, and the pointer changes into a pointing hand.

Step 4: Click the text string for which you want to create the checkpoint. The Text Checkpoint Properties dialog box opens.

Step 5: Specify whether it is expected as constant or parameter and then click OK.

Step 6: A checkpoint statement is added for the selected object.

Step 7: Execute the Script to see the Result.

b. To add a text checkpoint while editing a test:

Step 1: Make sure the Active Screen button is selected.

Step 2: Click the step where you want to add a checkpoint. The Active Screen displays the page or screen corresponding to the highlighted step.

Step 3: Highlight a text string on the Active Screen.

Step 4: Right-click the text string and choose Insert Text Checkpoint. The Text Checkpoint Properties dialog box opens.

Step 5: Specify the settings for the checkpoint.

Step 6: Click OK to close the dialog box. A checkpoint statement is added for the selected object.

9.3. Text Area Checkpoint:

Text area checkpoint checks that string is displayed within a defined area in an application build, according to specified criteria. For Example, your Visual Basic application has a button that says View Doc, where is replaced by a four digit code entered in a form elsewhere in the application. 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. Hence, to validate the existence of text in the specified screen area, it is better to use this checkpoint. This checkpoint allows four types of comparison between the expected value and selected screen area value:

  • Match case.
  • Exact Match.
  • Ignore Spaces.
  • Text Not Displayed (Allows blank space as valid).

You can add a text area checkpoint only while recording a test or component on Windows-based applications—Standard Windows, Visual Basic, and ActiveX.

Step 1: Choose Insert > Checkpoint > Text Area Checkpoint, or click the arrow next to the Insert Checkpoint button and choose Text Area Checkpoint. The Quick Test window is hidden, and the mouse pointer turns into a crosshairs pointer.

Step 2: Define the area containing the text you want Quick Test to check by clicking and dragging the crosshairs pointer. (See Considerations for Defining the Text Area.)

Tip: Hold down the left mouse button and use the arrow keys to make precise adjustments to the defined area.

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.

Step 3: Select the object for which you are creating the checkpoint. The Text Area Checkpoint Properties dialog box opens.

Step 4: Specify the checkpoint settings.

Step 5: Click OK to close the dialog box. A checkpoint statement is added for the selected object in the Keyword View and Expert View.

9.4. Bitmap Checkpoint:

Bitmap checkpoint checks an area of your web page or application as a bitmap. You use a bitmap checkpoint to compare an expected image to the actual image at run time, Pixel by Pixel.

For Example, you have a web site that displays a map of a city which is specified by a user. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms the map. By using the bitmap checkpoint, you can check whether the map zooms in correctly comparing with both, old map and new map.

Let us take another example. Suppose you have an application newly build that can display your company log. You can record the new logo and using the bitmap checkpoint, you can check that logo through the comparison of both the old build version logo and the current new build version logo for correctness.

Winrunner allows the static images only for comparison. However, QTP allows static images and dynamic images for comparison. To compare dynamic images, test engineers select multimedia option in the Add-in Manager. This checkpoint covers full images or, if required, part of images.

A bitmap checkpoint can be added to a test in two ways:

a. Inserting a bitmap checkpoint during Recording:

Step 1: Click on Record Button in Automation Menu or Record button in Testing Toolbar.

Step 2: Open the particular application that you want to insert the checkpoint. (Window Based Application or Web Based Application).

Step 3: Open the Standard Checkpoint by Insert> Checkpoint> Bitmap Checkpoint. The cursor changes to a pointer hand.

Step 4: Use the pointer hand cursor to select the bitmap that you want to check. The Object Selection-Bitmap Checkpoint Properties dialog box appears.

Step 5: Click OK to close the Object Selection –Bitmap Checkpoint Properties dialog box. The Bitmap Checkpoint Properties dialog box appears.

Step 6: The Bitmap Checkpoint Properties dialog bo x displays the bitmap that you want to check.

Step 7: Click OK to close the Bitmap Checkpoint Properties dialog box.

Step 8: Execute the script to analyze the result in the Result window.


b. Inserting a Bitmap checkpoint after recording:

To add a checkpoint after recording a test, you are Active Screen to select the fields for which you want to add checkpoints. If Active Screen is not active, click the Active Screen button.

To add a Bitmap checkpoint from Active Screen:

Step 1: On Active Screen, right click the object for which you want to add checkpoint and select Insert Bitmap Checkpoint from the menu. The Object Selection-Bitmap Checkpoint Properties dialog box appears.

Step 2: Click OK. The Checkpoint Properties dialog box appears.

Step 3: You want to check Bitmap for particular area means, click on Select Area button and select the particular area in the image, if required.

Step 5: Click on Ok to insert the Checkpoint.

Step 6: Execute the Script to verify the output in the Result window.

9.5. Database Checkpoint:

To automate backend testing on our application build, test engineers use database checkpoint. In backend-testing, the test engineers validate the impact of front-end operations on backend table’s content in terms of Data Validation and Data Integrity.

Data Validation means that the correctness of front-end values which are stored into backend tables.

(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.

Data Integrity means that the impact of newly stored values on existing values of database tables.

9.5.1. When executing a database checkpoint, the following events occur:

  1. The test arrives at the database checkpoint step and connects to the database.
  2. Quick test sends a query to the database to retrieve the actual data.
  3. Quick test gathers the result set of query, which provides the actual data.
  4. Quick test compares the actual data with the expected data, which is stored in the database checkpoint, to determine if the test passed or failed.

9.5.2. You can define database checkpoint in a test to check if:

  • The data is saved to the correct tables and columns of the database.
  • The data is updated in the database when a record is inserted, updated, or deleted in the AUT (Application under Test). This process is also called as data Presistence.
  • The data entered using the AUT is represented correctly in the database. Some of the properties that you check for data type, format, length and Spacing.
  • The data entered into the database is not duplicate.

There are Two Ways to open Database in QTP by

v Create Query using Microsoft Query.

v Specify SQL statements manually.

9.5.3. Specify SQL Statements Manually:

a. Data Validation:

Step 1: Open the Application and Enter the New Values in the Front End.

Step 2: To insert Checkpoint, Click on Insert>Checkpoint>Database Checkpoint.

Step 3: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed.

Step 4: Choose, Specify SQL Statements Manually option and click on Next.

Step 5: The Database Query Wizard-‘Specify SQL Statement’ Screen get displayed, here we want to insert the Database Path for that click on Create.

Step 6: Select Data Source Screen Displayed, Click on Machine Data Source.

Step 7: Select Particular Database eg: QT_Flight32, 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, and click on Finish.

Step 9: Now it displays the database for the application, then check the Result for Data Validation.

b. Data Integrity:

Step 1: Open the Application and open the Existed data from the database in Front End.

Step 2: Modify the value in the Front End, and Click on Update the Value.

Step 3: To insert Checkpoint, Click on Insert>Checkpoint>Database Checkpoint.

Step 4: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed.

Step 5: Choose, Specify SQL Statements Manually option and click on Next.

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 7: Select Data Source Screen Displayed, Click on Machine Data Source.

Step 8: Select Particular Database eg: QT_Flight32, 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, and click on Finish.

Step 10: Now it displays the database for the application, then check the Result for Data Integrity.

9.5.4. Create Query using SQL Query:

a. Data Validation:

Step 1: Open the application and enter the new values in the Front End.

Step 2: To insert Checkpoint, Click on Insert>Checkpoint>Database Checkpoint.

Step 3: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed.

Step 4: Choose, Create Query using Microsoft Query and click on Next.

Step 5: Instruction for Microsoft Query Screen Displays and click on OK.

Step 6: Choose Data Source Screen opens, from this screen choose the Database. E.g.: QT_Flight32*, and click on OK.

Step 7: Query Wizard-Choose Column Screen Displays, from this select the Column you want to add to Data table, Click on next.

Step 8: If you want filter the column name means filter the column name in the Query Wizard-Filter data, and click on next.

Step 9: if you want to sort the column means, sort it in Query Wizard- Sort Order, Click on Next.

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 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.

Step 12: Analyze the Result.

b. Data Integrity:

Step 1: Open the Application and open the Existed data from the database in Front End.

Step 2: Modify the value in the Front End, and Click on Update the Value.

Step 3: To insert Checkpoint, Click on Insert>Checkpoint>Database Checkpoint.

Step 4: The Database Query Wizard-‘Connect to database using ODBC’ screen gets displayed.

Step 5: Choose, Create Query using Microsoft Query and click on Next.

Step 6: Instruction for Microsoft Query Screen Displays and click on OK.

Step 7: Choose Data Source Screen opens, from this screen choose the Database. E.g.: QT_Flight32*, and click on OK.

Step 8: Query Wizard-Choose Column Screen Displays, from this select the Column you want to add to Data table, Click on next.

Step 9: If you want filter the column name means filter the column name in the Query Wizard-Filter data, and click on next.

Step 10: if you want to sort the column means, sort it in Query Wizard- Sort Order, Click on Next.

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.

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 13: Analyze the Result.

9.6. 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. For example, check if the images on a Web page include ALT properties, required by the W3C Web Content Accessibility Guidelines.

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). You can add accessibility checkpoints to help you quickly identify areas of your Web site that may not conform to the W3C Web Content Accessibility Guidelines. You can add automatic accessibility checkpoints to each page in your test, or you can add individual accessibility checkpoints to individual pages or frames.

9.7. XML Checkpoint:

You create XML file checkpoints to directly access and verify specific XML files in your system. 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 , and select XML Checkpoint (From Resource). The XML Source Selection - Checkpoint Properties dialog box opens.

Step 2: Select Create new checkpoint from file. Enter the file path or Internet address of the XML file.

Alternatively, click the browse button to open the Open XML File dialog box, and then navigate to the XML file for which you want to create a checkpoint. You can specify an XML file either from your file system or from Quality Center. Select the file and click Open. The file path and name are entered in the box.

Step 3: Click OK in the XML Source Selection - Checkpoint Properties dialog box. The XML Checkpoint Properties dialog box opens.

Step 4: In the Name box, either accept the name that QuickTest assigns to the checkpoint or specify another name for it. By default, the checkpoint name is the name of the test object on which the checkpoint is being performed.

If you rename the checkpoint, make sure that the name is unique, does not begin or end with a space, and does not contain the following character/combination of characters: " := @@

Step 5: Select the items to check for the checkpoint

Step 6: When you finish setting your checkpoint preferences, click OK to add the XML checkpoint. A checkpoint similar to the following is added to the Keyword View.

QuickTest inserts this step as follows in the Expert View:

XMLFile("availcities.xml").Check CheckPoint("availcities.xml")