Saturday, November 28, 2009

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")


No comments:

Post a Comment