Friday, 19 August 2011

Checkpoints & Output Values


Check points overview

QuickTest enables you to add checks to your test. 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, QuickTest inserts a checkpoint step to the current row in the Keyword View and adds a Check CheckPoint statement in the Expert View. By default, QuickTest names the checkpoint using the name of the test object on which the checkpoint was created. You can choose to specify a different name for the checkpoint or accept the default name.

When you run the test, QuickTest compares the expected results of the checkpoint to the current results. If the results do not match, the checkpoint fails. You can view the results of the checkpoint in the Run Results Viewer. 

Adding Existing Checkpoints to a Test
QuickTest enables you to reuse existing checkpoints. When you create checkpoints, consider which checkpoints can be reused in multiple locations in your test or in multiple tests. For example:
  • Checkpoints that check generic content or the state of your application may be useful in multiple locations.
  • Checkpoints that check the content of a specific area of your application are generally useful in only one particular place in your test.
The following examples illustrate situations in which inserting an existing checkpoint may be useful:
  • If each page of your application contains your organization's logo, you can reuse a bitmap checkpoint to verify each occurrence in the application.
  • If your application contains multiple edit boxes, you can reuse a checkpoint to confirm the enabled status of these edit boxes throughout your test.

Checkpoint Types

You can insert the following checkpoint types to check objects in an application:

Checkpoint Type
Description
Standard Checkpoint
Checks property values of an object in your application. For example, you can check that a radio button is activated after it is selected or you can check the value of an edit box.
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.
You create an image checkpoint by inserting a standard checkpoint on an image object.
Image checkpoints are supported for the Web add-in environment.
Bitmap Checkpoint
Checks an area of your application as a bitmap. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create a bitmap checkpoint for any area in your application.
Bitmap checkpoints are supported for all add-in environments.
Table Checkpoint
Checks information within a table. For example, suppose your application contains a table listing all available flights from New York to San Francisco. You can add a table checkpoint to check that the time of the first flight in the table is correct.
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. Table checkpoints are also supported for some list view objects, such as WinListView and VbListView, as well as other list view objects in add-in environments.
Text Checkpoint
Checks that a text string is displayed in the appropriate place in an 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".
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. For example, suppose your Visual Basic application has a button that says View Doc <Num>, where <Num> is replaced by the 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 the same as the number entered in the form.
Text area checkpoints are supported for all Windows-based environments, such as Standard Windows, Visual Basic, and ActiveX add-in environments. Text area checkpoints are also supported for some other add-in environments, such as Java.
Accessibility Checkpoint
Identifies areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines. For example, guideline 1.1 of the W3C Web Content Accessibility Guidelines 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. For example, you can check how long a Web page takes to load or whether a Web page contains broken links.
You 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. For example, you can use a database checkpoint to check the contents of a database containing flight information for your Web site.
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.


Output Values Overview

QuickTest enables you to retrieve values in your test and store them in output value objects. You can subsequently retrieve these values and use them as input at a different stage in the run session.
An output value step is a step in which one or more values are captured at a specific point in your test and stored for the duration of the run session. The values can later be used as input at a different point in the run session.
You can output the property values of any object. You can also output values from text strings, table cells, databases, and XML documents.
When you create output value steps, you can determine where the values are stored during the run session and how they can be used. During the run session, QuickTest retrieves each value at the specified point and stores it in the specified location. When the value is needed later in the run session, QuickTest retrieves it from this location and uses it as required.
Output values are stored only for the duration of the run session. When the run session is repeated, the output values are reset.
Note: After the run session, you can view the output values retrieved during the session as part of the session results.

Output Value Categories

You can create the following categories of output values: 

Standard Output Values
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.
Note:
·  You can also use standard output values to output the contents of table cells.
·  You can use standard output values to output text strings by specifying the text property of the object as an output value. 

Table Output Values
Table output values are a subset of standard output values. You can use table output values to output the contents of table cells. For some types of tables, you can specify a row range from which to choose the table cells. During the run session, QuickTest retrieves the current data from the specified table cells according to the settings that you specified and outputs the values to the data table. 

Text and Text Area Output Values
You can use text output values to output text strings displayed in an 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-based 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).
Note: You can create a text area output value only while recording on Windows-based applications. 

Database Output Values
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, QuickTest retrieves the current data from the database and outputs the values according to the settings that you specified. 

XML Output Values
You can use XML output values to capture and output the values of XML elements and attributes in XML documents.
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.
After the run session has finished, you can also view the captured data by opening the XML Output Value Results window from the Run Results Viewer. 

Existing Output Values
QuickTest enables you to insert existing output values into your test.
When you insert an existing output value in your test, consider which output values should be used in multiple locations in your test. Each time an output value step is performed, the value contained in the output value is overwritten with the new output value. You should insert an existing output value into your test only if the stored value will no longer be needed by your test when the output value object is used again.

No comments:

Post a Comment