HP QTP Question Bank: Q. 101 to 110
Q. 101: What is the process of capturing visible portion of an object in QTP?
QTP captures the visible part of the specified object as a bitmap and inserts a checkpoint in the test. QTP does not capture any part of the screen which happens to be scrolled off the screen. We can check an area of an application as a bitmap. While creating a test, we specify the area you want to check by selecting an object. We can check an entire object or any area within an object.
<<<<<< =================== >>>>>>
Q. 102: What is the process of comparing selected area of object with Bitmap stored in the checkpoint?
When we run the test, QTP compares the object or selected area of the object in the application with the bitmap stored in the checkpoint.
If there are differences, QTP captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), we can identify the nature of the discrepancy.<<<<<< =================== >>>>>>
Q. 103: How can we define a time interval for QTP to perform a checkpoint successfully?
For defining some time interval (say in seconds) during which QTP shopuld attempt to perform the checkpoint successfully, we need to specify the Checkpoint Timeout. QTP 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.
For example, suppose it takes some time for an object to achieve an expected state. Increasing the checkpoint timeout value in this case can help ensure that the object has sufficient time to achieve that state, enabling the checkpoint to pass (if the data matches) before the maximum timeout is reached.
<<<<<< =================== >>>>>>
Q. 104: How can we check the object property values in our application?
We can check that a specified object in our application has the property values we expect, by adding a standard checkpoint step to our test while recording or editing the test. Standard checkpoints compare the expected values of object properties to the object�s current values during a run session.
We can use standard checkpoints to perform checks on images, tables, Web page properties, and other objects within our application.
<<<<<< =================== >>>>>>
Q. 105: How can we identify a checkpoint in QTP?
We identify a checkpoint by its name. By default, the checkpoint name is the same as the name of the test object on which the checkpoint was created. We can specify a different name for the checkpoint or accept the default name.
If we want to rename a checkpoint, make sure that the name is unique, and it does not begin or end with a space, and does not contain the special charactesr like ” := @@
<<<<<< =================== >>>>>>
Q. 106: How can we Insert statement option when adding a checkpoint during the recording?
The Insert statement option is not available when adding a checkpoint during recording or when modifying an existing object checkpoint.
It is available only when adding a new checkpoint to an existing test while editing it.
<<<<<< =================== >>>>>>
Q. 107: How can we compare the image files in the Image Checkpoint?
We can compare the image files in the Image Checkpoint by using the Compare image content option in the Image Checkpoint Properties dialog box. It compares the expected image source file with the graphic of the actual image source file. If the expected and actual images are different, QTP displays them both in the Test Results. If the images are identical, only one graphic is displayed.
<<<<<< =================== >>>>>>
Q. 108: How can we check the contents of tables in our application in QTP?
We can check the contents of tables in our application by adding table checkpoints to the test. For example, we can check that a specified value is displayed in a particular cell. We can also check the properties of the table object. For example, we can check that a table has the expected number of rows and columns.
When we run the test, the table checkpoint compares the actual data to the expected data, as defined in the checkpoint. If the results match, the checkpoint passes.
<<<<<< =================== >>>>>>
Q. 109: How do we compare actual cell values with the expected cell values in Tables in QTP?.
By using the Settings tab we can compare actual cell values with the expected cell values in tables. By using Verification type option we can compare following types of cell contents.
1) String Content: It is the default setting. It treats the cell values as strings and checks for the exact text, while ignoring spaces. For example, 2 and 2.00 are not recognized as the same string.
2) Numeric Content: Evaluates the content of the cell according to numeric values. For example, 2 and 2.00 are recognized as the same number.
3) Numeric Range: Compares the content of the cell against a numeric range, where the minimum and maximum values are any real number that we specify.
<<<<<< =================== >>>>>>
Q. 110: How can we check the location of a cell to be checked in a Column of a table?
By the use of Identify columns option available in Cell Identification tab. This specifies the location of the column containing the cells with which we want to compare the expected data. This is done in two ways:
1) By position: This is the Default option. It locates cells according to the column position. A shift in the position of the columns within the table results in a mismatch.
2) By column name: It locates cells according to the column name. A shift in the position of the columns within the table does not result in a mismatch. This option gets enabled only when the table contains more than one column.
Continue to Next Part : Q 111 to 120
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.