正文

checkpoint

(2011-06-03 13:04:34) 下一个

Checkpoints Overview
A checkpoint is a verification that compares the current value for specified properties or current state of other characteristics of an object with the expected value or characteristics. This helps you to identify whether your application is functioning correctly.
When you add a checkpoint, QTP adds a Check CheckPoint statement in the Expert View.
QuickTest enables you to reuse existing checkpoints.If each page of your application contains your organization’s logo, you can reuse a bitmap checkpoint to verify each occurrence in the application.

Checkpoint Types
Standard Checkpoint: Checks property values of an object in your application. Standard checkpoints are supported for all add-in
environments.

Image Checkpoint: Checks the value of an image in your application. For example, you can check that a selected image’s source file is correct.Image checkpoints are supported for the Web add-in environment.

Bitmap Checkpoint: Checks an area of your application as a bitmap.Bitmap checkpoints are supported for all add-in environments.

Table Checkpoint: Checks information within a table. You create a table checkpoint by inserting a standard checkpoint on a table object. Table checkpoints are supported for all add-in environments that have a *Table test object.

Text Checkpoint:Checks that a text string is displayed in the appropriate place in an application. Text checkpoints are supported for most add-in environments.

Text Area Checkpoint: Checks that a text string is displayed within a defined area in a Windows-based application, according to specified criteria.Text area checkpoints are supported for all Windows-based environments supported for some other add-in environments, such as Java.

Accessibility Checkpoint: Identifies areas of your Web site that may not conform to the W3C Web Content Accessibility Guidelines that requires you to provide a text equivalent for every non-text element. You can add an Alt property check to check whether objects that require the Alt property under this guideline, do in fact have this tag. Accessibility checkpoints are supported for the Web add-in environment.

Page Checkpoint: Checks the characteristics of a Web page.create a page checkpoint by inserting a standard checkpoint on a page object. Page checkpoints are supported for the Web add-in environment.

Database Checkpoint: Checks the contents of a database accessed by your application. Database checkpoints are supported for all add-in environments.

XML Checkpoint: Checks the data content of XML documents in XML files or XML documents in Web pages and frames. The XML Checkpoint (Web Page/Frame) option is supported for the Web add-in environment. The XML Checkpoint option is supported for all add-in environments.

Tips and considerations for inserting checkpoints
If you want to retrieve the return value of a checkpoint, you must add parentheses around the checkpoint argument in the statement in the Expert View. For example:
a = Browser("MyBrowser").Page("MyPage").Check (CheckPoint("MyProperty"))

You can also use the CheckProperty method and the CheckItemProperty method to check specific property or item property values.

Task: How to Insert a Checkpoint Step in a Test

Insert a new checkpoint step while recording your test

Insert a new or existing checkpoint while editing your test

Add Existing Checkpoint


Standard Checkpoints
You can use standard checkpoints to perform checks on images, tables, Web page properties, and other objects within your application.

Task: How to Create or Modify a Standard Checkpoint Step
Add P610 picture
The name that QuickTest assigns to the checkpoint object. By default, the name is the same as the name of the object on which the checkpoint step is being performed. You can specify a different name for the checkpoint object or accept the default name.
Checkpoint timeout: Specifies the time interval (in seconds) during which QuickTest attempts to perform the checkpoint successfully. QuickTest continues to perform the checkpoint until it passes or until the timeout occurs. If the checkpoint does not pass before the timeout occurs, the checkpoint fails.
Image Checkpoint Properties: Compare image content: Enables you to compare the expected image source file with the actual image source file.

Bitmap Checkpoints
Comparing bitmaps of objects. You can check an entire object or any area within an object.The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

Fine-Tuning the Bitmap Comparison
A bitmap checkpoint compares pixel by pixel. By default, if any pixels are different, the checkpoint fails. You can adjust the comparison to enable the checkpoint to pass even if the bitmaps are not identical by setting the RGB tolerance and Pixel tolerance.
RGB tolerance The RGB (Red, Green, Blue) tolerance determines the percent by which the RGB values of the pixels in the actual bitmap can differ from those of the expected bitmap and allow the checkpoint to pass.
Pixel tolerance: The pixel tolerance determines the number or percentage of pixels in the actual bitmap that can differ from those in the expected bitmap and allow the checkpoint to pass.

Tasks: How to Create or Modify a Bitmap Checkpoint Step
Prerequisites and considerations for inserting a new bitmap checkpoint step--Object visibility in application
Make sure the object is fully visible in your application before inserting a bitmap checkpoint on it. During a run session, bitmap checkpoints can capture only the visible part of an object. One way to do this is to insert a MakeVisible statement (for relevant environments) prior to your bitmap checkpoint step.

Bitmap Checkpoint Properties Dialog Box
Add  P626 pic

Table Checkpoints
you can check that a
specified value is displayed in a certain cell. For some environments, you can also check the property values of the table object. For example, you can check that a table has the expected number of rows and columns.

Task: How to Create or Modify a Table Checkpoint Step
Table Checkpoint Properties Dialog Box: Add p 639 pic
Considerations for Modifying Row Ranges:If your modified row range includes some or all of the rows that were already included in the checkpoint, the expected values of those cells are not changed. This enables you to modify the row range without losing parameterization, regular expressions, or other changes you may have made to the expected cell values in your checkpoint. Therefore, you cannot use the Modify Row Range dialog box to update the expected values of an existing table checkpoint. To update the expected values of your checkpoint, use the Update Run Mode option.
Check Table Content: Instructs QuickTest to check the content of the table object. (Selected by default.)
Check Properties: Instructs QuickTest to check the properties of the table object.
Cell Identification Tab:Identify columns: By position. (Default); By column name. Identify rows: By row number; By selected key column(s).

Text Checkpoints
You can check that a specified text string is displayed by adding one of the following checkpoints to your test.
Standard Checkpoint. Enables you to check the text property of an object.
Text Area Checkpoint. Enables you to check that a text string appears within a defined area in a Windows application.
Text Checkpoint. Enables you to check that the text is displayed in a screen, window, or Web page, according to specified criteria.
By default, when checking text, QuickTest tries to retrieve the text directly from the object.

Task: How to Create or Modify a Text or Text Area Checkpoint Step
Text / Text Area Checkpoint Properties Dialog Box: add P660
The captured area must be large enough to include all parts of the required text (Checked Text / Text Before / Text After).
Exact match: Checks for the exact expected text. For example, if you create a checkpoint with the following description, Check that New York is displayed between Flight departing from and to San Francisco, and select Exact match, if the actual text is New York City, the checkpoint fails. If you do not select Exact match, the checkpoint passes because the expected text is contained within the actual text.

[ 打印 ]
阅读 ()评论 (0)
评论
目前还没有任何评论
登录后才可评论.