Saturday, October 30, 2010

QTP Interview Question Part 2

1. How can I remove test result files from old tests?
We can use the TEST RESULTS DELETION TOOL to view a list of all of the test results in a specific location in your file system or in your Quality Center project. You can then delete any test results that you no longer require.
The Test Results Deletion Tool enables you to sort the test results by name, date, size, and so forth, so that you can easily identify the results you want to delete.

To open this utility, choose Start > Programs > QTP Professional > Tools > Test Results Deletion Tool.

2. What are the ways by which we can make QTP to wait?

WaitProperty: We can insert a synchronization point, which instructs QTP to pause the test until an object property achieves the value we specify.
Syntax: Object.WaitProperty ("Property Name", Expected Value, Timeout)

Exist: Wait for specified time interval until an Object Existence become TRUE
Syntax: Object.Exist (Timeout)

Wait: Wait for specified time interval before continuing the test
Syntax: Object.Wait (Timeout)

3. How to handle dynamic objects in QTP?
QTP generally identifies an object by matching test object properties with run time object properties. It may fail to recognize the dynamic objects whose properties change during run time. QTP has an option of enabling Smart Identification wherein it can identify the objects even if their properties changes during run time.

Smart Identification mechanism uses two types of properties:
  • Base Filter Properties: This is most fundamental properties of a particular test object class whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from to any other value; you could no longer call it the same object.

  • Optional Filter Properties: Other properties that can help to identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable

4. Checkpoints in QTP
Type
Description
Mode of Applying
Example
Standard Checkpoint
Check Property Value of an Object
Recording Time
In Editing Test
Check that radio button is selected
Image Checkpoint
Check the property Value of an Image
Recording Time
Check that Image source file is correct
Bitmap Checkpoint
Check an area of webpage or application after capturing as Bitmap
Recording Time
In Editing Test
Check that webpage is displayed as expected
Table Checkpoint
Check the information in a Table
Recording Time
Check that value in a table cell is correct
Database Checkpoint
Check the content of database access by application
Recording Time
Check that Value in database query is correct
Text/Text Area Checkpoint
Check that text string is displayed at appropriate place in webpage or window application
Recording Time
In Editing Test
Check that whether string is displayed at expected place
Page Checkpoint
Check the characteristic of Page
Recording Time
Check that how long a web page takes to load
Accessibility Checkpoint
Identify the area of website to check for section 508 compliancy
Recording Time

XML Checkpoint
Check the data content of XML document
Recording Time
Check specified XML file

5. What is a Text and Text Area Check Point in QTP?
Text Checkpoint enables us to check that a text string appears within a screen, window, or Web page, as per the specified criteria. It is supported for all environments.

Text Area Checkpoint enables us to check that a text string appears within a defined area of a Windows application, as per the specified criteria. It is supported for Standard Windows, Visual Basic, and ActiveX environments.

6. What is Test Object Method in QTP?
The test object model is a large set of object types or classes that QTP uses to represent the objects in our application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that QTP can record for it.
A run-time object is the actual object in our application on which methods are performed during the run session.
When you perform an operation on your application while recording, QTP:
  • Identifies the QTP test object class that represents the object on which we performed the operation and creates the appropriate test object
  • Reads the current value of the object's properties in our application and stores the list of properties and values with the test object
  • Chooses a unique name for the object, generally using the value of one of its prominent properties
  • Records the operation that we performed on the object using the appropriate QTP test object method

For example, suppose we click on a Search button with the following HTML source code:
<input name="Search" value="Search" type="submit">
QTP identifies the object that you clicked as a WebButton test object. It creates a WebButton object with the name Search, and records the following properties and values for the Search WebButton

7. Explain in brief about the QTP Automation Object Model.
Essentially all configuration and run functionality provided via the QTP interface is in some way represented in the QTP automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QTP have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the QTP automation object model, along with standard programming elements such as loops and conditional statements to design your program.

8. What is a Run-Time Data Table? Where can I find and view this table?
In QTP there is a data table used which is used at runtime. This is basically an excel file which stored in the folder of test created. Its name is Default.xls by default.

Navigation: View->Data table

9. How does Parameterization and Data-Driving relate to each other in QTP?
For Data-Driving we have to make constant as parameter so that in each iteration, it takes the value from run time data table.

10. Explain the concept of how QTP identifies object.
During recording QTP looks at the object and stores it as test object. For each test object QTP learns a set of default properties called mandatory properties. It looks at the other objects property if the mandatory properties are not sufficient to create unique object property. During test run, QTP searches for the run time objects that match with the test object it learned while recording.

No comments: