30 December 2012

QTP Interview questions


Q. 1: What is Automation Object Model in QTP?
Like we use QTP for automating the testing of our applications, we can use the automation object model of QTP to automate its own operations as well. With the help of objects, methods, and properties exposed by the automation object model of QTP along with standard programming elements like loops and conditional statements, we can write programs which can configure QTP options and run tests or components instead of performing these operations manually using the QTP interface.
Automation programs are useful for performing the same tasks several times or on multiple tests or components, or quickly configuring QTP according to the needs for a particular environment or application.
Most of the dialog boxes in QTP have a corresponding automation object. Most of the options in dialog boxes can be set retrieved using the corresponding object property, and most of the menu commands and other operations have corresponding automation methods.


<<<<<< =================== >>>>>>

Q. 2: What is a Recovery Scenario?
Recovery scenario gives us an option to take some action for recovering from a fatal error in the test. Such problems are quite frequent especially when the tests are made to run unattended. In such a case the test process halts until the user perform some desired recovery operation.
Recovery scenarios are useful when it is difficult to predict at which step the errors can come or when we are confident that the error will not come in the QTP script, whereas it can be anywhere outside the QTP Script. For illustration; Pop-up message of "out of paper", as caused by the printer device driver. "On error resume next" is preferred when we are sure that the error is expected one and wish to perform some other actions.
<<<<<< =================== >>>>>>

Q. 3: What is Smart Identification in QTP?
QTP has a unique feature by the name Smart Object Identification or recognition which is used for identifying the objects smartly, whenever the normal identification fails due to the dynamic changes in the properties of the objects.
Smart Identification is nothing but an algorithm used by the QTP when it is not able to recognize an object.
<<<<<< =================== >>>>>>

Q. 4: How QTP identifies various Objects?
During recording QTP identifies various objects and stores them as test objects. For each test object QTP learns a set of default properties called mandatory properties. Simultaneously QTP looks at rest of the objects to check whether these properties are sufficient to uniquely identify the object or not. During the test run, QTP searches for the run time objects, which match with the test objects which, have been captured by it during recording.
<<<<<< =================== >>>>>>

Q. 5: What are Object Repositories in QTP?
When planning and creation of tests is done, we firstly consider how we would like to store the objects in our tests. In QTP, the test objects can be stored in two types of object repositories
a) Shared Object Repository: It stores test objects in a file that can be accessed by multiple tests. If someone is new to QTP, he can prefer to use local object repositories. This way he can record and run the tests without creating, choosing, or modifying shared object repositories because all objects are automatically getting saved in a local object repository which can be accessed by its corresponding action.
b) Local Object Repository: It stores objects in a file that is associated with one specific action, so that only that action can access the stored objects. If someone is familiar with QTP testing, he can find that it is quite efficient to save the objects in a shared object repository. This way, he can use the same shared object repository for multiple actions - if the actions include the same objects. Test object information that applies to many actions is kept in one centralized location. When the objects in the application change, we can update them in one location for all the actions that use this shared object repository.
<<<<<< =================== >>>>>>

Q. 6: How QTP recognizes objects in Object Repositories?
Object Repository displays a tree of all the objects in the current component or in the current action or in the entire test, depending on the object repository mode selected by the user. We can view or modify the test object description of any test object in the repository or to add new objects to the repository.
QTP remembers the default property values and determines in which test object class it fits. If it is not found enough it automatically adds assistive properties, one by one to the description until it successfully compiles the unique description. If no assistive properties are available, then it adds a special Ordinal identifier such as object location on the page or in the source code.

<<<<<< =================== >>>>>>
Q. 7: How many types of Actions are there in QTP?
QTP uses three kinds of actions like:
a) Non-reusable Action: Can be called only in the test with which it is stored, and can be called only once.
b) Reusable Action: Can be called multiple times by the test with which it is stored as well as by other tests.
c) External Action: Is a reusable action which is stored with another test. External actions are read-only in the calling test, but we can choose to use a local, editable copy of the Data Table information for the external action.
By default, all new actions are non-reusable. We can mark every action created by us in the test as reusable or non-reusable.
<<<<<< =================== >>>>>>

Q. 8: Is there any built-in function for Scripting in QTP?
QTP uses an in-built functionality called "Step Generator" to create scripts while appropriate steps are entered into it. Step Generator utility enables us to add steps by selecting from a range of context-sensitive options and entering the required values.
We can open the Step Generator from the Keyword View or Expert View while recording or editing our test. We can also open the Step Generator from the Active Screen while editing.
Method to open the Step Generator from a function library is as under:
a) In the function library, click the location in which we want to insert the new step.
b) Choose Insert > Step Generator, or right-click and choose Step Generator. Alternatively, press F7.
<<<<<< =================== >>>>>>

Q. 9: What is a Run-Time Data Table in QTP?
During the run session, QTP creates a Runtime Data Table, which is live version of the Data Table associated with our test. During the run session, QTP displays the run-time data in the Data Table pane so that we can see the changes taking place in the Data Table.
When the run session ends, the Runtime Data Table closes, and the Data Table pane again displays the stored design-time Data Table. Data entered in the run-time Data Table during the run session does not get saved along with the test. The final data from the run-time Data Table gets displayed in the Run-Time Data Table in the Test Results window.
Runtime Data Table is an excel file, which gets stored in the folder of the test created, its name is Default.xls by default.
<<<<<< =================== >>>>>>

Q. 10: What is the Object Spy feature in QTP?
Using the Object Spy pointing hand mechanism, we can view the supported properties and methods of any object in an open application. As we move the pointing hand over the objects in the application, their details are displayed in the Object Spy. These details may include the test object’s hierarchy tree, its properties and values, and the methods associated with the object. For methods, the syntax is also displayed.
Q. 11: What is a Virtual Object in QTP?
Since sometimes complex objects are not recognized & recorded properly by QTP. Hence an experienced user can define that object as a personal virtual object and build a virtual object repository. This way by the concept of Virtual Object, the user can add some sort of support for such complex objects.
If it is possible to extract the desired information from the object, we can do successful record and playback against that object.
<<<<<< =================== >>>>>>

Q. 12: How results are generated in QTP?
At the end of the test, QTP generates a result file for the test cases, which is in the form of a XML tree.
This results file provides detail regarding 'Pass' or 'Fail' counts, error messages, and all supporting information which allows the user to diagnose the main cause of a failure
.
<<<<<< =================== >>>>>>
Q. 13: How many types of main views of a script are available in QTP?
QTP provides two main views of a script.
1) Keyword View: It is the default test procedure interface of QTP & is most useful for the beginners. It displays the automation steps of a test procedure as a descriptive tree of Actions and functions. The tree contains columns listing the Action or function name, any parameters, and comments.
2) Expert View: It is most suitable for the advanced users, enabling them to customize the test, like writing user-defined functions. It is meant for displaying and editing of the source code of the test. Except for the root Global action, all other test actions can be edited here. Expert View acts as an IDE for the test. It includes most standard IDE features, such as breakpoints.

<<<<<< =================== >>>>>>
Q. 14: What is a Checkpoint?
In QTP, Checkpoint is used to verify the application under test. It can introduce a checkpoint to verify as to whether a particular object, text or a bitmap is present in the automation run.
During a test execution, a checkpoint verifies that the behavior or state of the actual application is consistent with the expected application or not.
<<<<<< =================== >>>>>>

Q. 15: How many types of Checkpoints are available in QTP
1) Standard Checkpoint - for checking the properties of an object.
2) Table Checkpoint - for checking the properties of a table.
3) Image Checkpoint - for checking the properties of an image.
4) Bitmap Checkpoint - for comparing an area of the application under test pixel-by-pixel with the screen as seen at record-time.
5) Database Checkpoint for automating the back-end testing.
6) Text Checkpoint - for checking that a section of text is found between two other sections of text.
7) Text Area Checkpoint
8) Page Checkpoint - for checking the properties of a web page.
9) Accessibility Checkpoint - for checking the accessibility of an application.
10) XML Checkpoint
<<<<<< =================== >>>>>>
Q. 16: What is the use of Text Output Value in QTP?
Text Output values enable us to view the values which are taken by the application during the run time. If parameterized, the values change for every iteration. Hence by creating output values, we can capture the values which are taken by the application during the run time and output them to the data table.
<<<<<< =================== >>>>>>
Q. 17: What's the difference between a Checkpoint and Output Value?
Checkpoint only checks for the specific attribute of an object in AUT while Output value can output those attributes value to a column in a data table.

Q. 18: How can we Disable Smart Identification During the Run Session?
Selection of the option "Disable Smart Identification during the run session", Instructs QTP not to use the Smart Identification mechanism during the run session.
When we select this option, the Enable Smart Identification check boxes in the Object Properties and Object Repository dialog boxes get disabled, although the settings are saved. However when we clear this option, the Enable Smart Identification check boxes return to their previous on or off setting.
<<<<<< =================== >>>>>>
Q. 19: What are the Properties used by Smart Identification Feature of QTP?
1) Base Filter Properties: Are the most fundamental properties of a particular test object class. Here we can not change their values without changing the essence of the original object.

2) Optional Filter Properties: Are other properties, which help us in identifying the objects of a particular class since these are not likely to get changed frequently. These properties can be ignored in case these are not applicable any more.
<<<<<< =================== >>>>>>
Q. 20: How can we check if an environment variable exists or not?
When we use Environment("Param1").value then QTP expects the environment variable to be already defined. But when we use Environment.value("Param1") then QTP will create a new internal environment variable if it does not exists already. So to be sure that variable exist in the environment try using Environment("Param1").value.
Q. 21: Where can we use a Function or an Action?
It all depends on the scenario.
If we want to use the OR feature then we have to go for Action only. If the functionality is not about any automation script i.e. a function like getting a string between to specific characters, now this is something not specific to QTP and can be done on pure VB Script, so this should be done in a function and not an action. Code specific to QTP can also be put into an function using DP. Decision of using function / action depends on what any one would be comfortable using in a given situation.
<<<<<< =================== >>>>>>
Q. 22: What is the difference between an Action and a Function?
Action is a activity specific to QTP while functions are a generic thing which is a feature of VB Scripting.
Action can have a object repository associated with it while a function can't. A function is just lines of code with some / none parameters and a single return value while an action can have more than one output parameters.
<<<<<< =================== >>>>>>
Q. 23: What are the various events available in the Recovery Scenario Manager?
1) Application Crash: This event is useful in handling crashed applications at runtime.
2) Pop Up Window: This event is useful in managing various unwanted application windows, which get built-up at runtime.
3) Test Run Error: This event is useful in handling VBScript statement errors at runtime.
4) Object State: This event is useful in handling object related errors at runtime.
<<<<<< =================== >>>>>>
Q. 24: What are the Elements of Recovery Scenario?
Steps to handle the exceptions are
1) Trigger Event: Is an unexpected event like appearance of a Pop-up window, object state, test run error causing application crash or interruption in our running session.
2) Recovery Steps: Constitutes a series of steps required to be performed to enable QTP to proceed further with the process of test after some trigger event has interrupted the run session. Examples of a recovery operation can be 1) A keyboard or mouse Operation like a Click over the "OK" button in the Pop-up window 2) Close Application Process 3) Function Call 4) Restarting the OS etc.
3) Post-Recovery Test Run: Are a set of instructions designed to be provided to QTP on proceeding further with the test after some recovery operation has been carried out. Examples of Post Recovery actions can be repeating the complete test from the beginning or some steps may be skipped altogether & continuing with the remaining steps in the test.
<<<<<< =================== >>>>>>
Q. 25: When to use a Recovery Scenario and When to use "on error resume next"?
Recovery scenarios are useful when it is difficult to predict at which step the errors can come or when we are confident that the error will not come in the QTP script, whereas it can be anywhere outside the QTP Script.
For illustration; Pop-up message of "out of paper", as caused by the printer device driver. "On error resume next" is preferred when we are sure that the error is expected one and wish to perform some other actions.
<<<<<< =================== >>>>>>
Q. 26: What are the key features of QTP at a glance
# Ease of Use: QTP allows even novice testers to become productive in minutes. We can create a test script by simply pressing a Record button and using an application to perform a typical business process. Each step in the business process is automated documented with a plain-English sentence and screen shot. Users can easily modify, remove, or rearrange test steps in the Keyword View.
# Simple Interface: QTP is much simpler to understand. It presents a test case as a simple business workflow to the tester.
# Simple Language: QTP uses Microsoft's VBScript for its test procedures, and to manipulate the objects and controls of the application under test. VBScript is a real programming language where several existing functions & resources are easily available for implementation these days.
# Use of Zero-Configuration Technology: QTP uses next-generation "zero-configuration" Keyword Driven testing technology. This helps in faster test creation, easier maintenance, and provides more powerful data-driving capability.
# Automatic Insertion of Checkpoints: QTP enables thorough validation of applications through a full complement of checkpoints. QTP can automatically introduce checkpoints to verify application properties and functionality, for example to validate output or check link validity.
# Marvelous Interface with Data-tables: QTP allows entry of test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files. QTP has better and easier to use Data table integration compared to WinRunner.
# Better Object Identification Mechanism: QTP Identifies objects with Unique Smart Object Recognition, even if objects change from build to build, thereby enabling reliable unattended script execution.
# Support of Variety of Environment: QTP supports functional testing of all popular environments, like Windows, Web, .Net, Visual Basic, ActiveX, Java, SAP, Siebel, Oracle, PeopleSoft, terminal emulators, and Web services.
# Easy Adaptability of Microsoft Object Models: QTP can easily create and implement Microsoft Object Model like: Outlook objects, ADO objects, FileSystem objects, supports DOM, WSH, etc.
# Auto-Documentation Technology: QTP renders test documentation and test creation to a single step with the help of its auto-documentation technology
<<<<<< =================== >>>>>>
Q. 27: What are various types of properties when using Object Identification in QTP?
QTP uses three types of properties when identifying an object
1. Mandatory Properties: Always learn these properties for the object
2. Assistive Properties: Learn in case Mandatory properties are not enough to identify the object uniquely
3. Ordinal Identifiers: Learn in case both mandatory and assistive properties are not able to recognize the objects correctly
<<<<<< =================== >>>>>>
Q. 28: What are the various ways to insert a Action in a test in QTP?
There are three ways to insert an Action in a test
1. Insert Call to New…
2. Insert Call to Copy…
3. Insert Call to Existing…
<<<<<< =================== >>>>>>
Q. 29: What is the use of Parameterization in QTP?
Parameterization is helpful in aspects like:
# Parameterization allows us to pick different values at run time.
# Reduces Time and Effort.
# Usage of data drivers allows us to use the same data for various input boxes.
# Parameterization can also be done for checkpoints.
<<<<<< =================== >>>>>>
Q. 30: What are Data Tables in QTP?
Data Table is MS Excel like spreadsheet which can be used for parameterizing a test case
DataTable are of two types like:
1. Global Data Table: Is a Data table for Test flow
2. Local Data Table: Is a Data table for every action
Q. 31: What are the Environment Variables?
Environment variables are global variables available to all Actions
# They can be used to run a test case on different environment
# To add a new Environment variable go to Test -> Settings…->Environment (Tab)
# Environment variables are of two types like:
1. Built in Environment Variables: These provide information about the system and the current test
2. User-Defined Environment Variables: These are added in the Environment tab of Test Settings. These are Read-only during the test run
<<<<<< =================== >>>>>>

Q. 32: How many types of Parameters are there in QTP?

There are two types of parameters like:

1) Test parameters:
# These can be set in Test->Settings…->Parameters (Tab)
# Test parameters value can be provided when replaying the test
# Test arguments can be accessed in the test using TestArgs("")

2) Action parameters :
# Used to pass parameters to Action
# Output parameters can only be used when Action is being called for a single iteration
# Ex - RunAction "Login", oneIteration, "TestUser", "TestPass", out

# A parameter can be accessed using Parameter("ParamName")

<<<<<< =================== >>>>>>

Q. 33: What is Descriptive Programming?

Descriptive Programming is an alternate way of writing test cases without having objects in object repository

Descriptive programming can be done in two ways

1. Using Object Description
2. Using String Description

In Descriptive Programming objects are identified by describing all the identification properties

<<<<<< =================== >>>>>>

Q. 34: After creating the test, what is the purpose of running them?

1) To Check the Application: The test starts running from the first line in our test and stops at the end of the test. While running, QTP connects to our application and performs each operation in our test, including any checkpoints, such as checking any text strings, objects, tables, and so forth. If we had parameterized our test with Data Table parameters, QTP repeats the test (or specific actions in your test) for each set of data values we had defined.

2) To Debug the Application: We can control our run session to help us identify and eliminate defects in our test. We can use the Step Into, Step Over, and Step Out commands to run our test step by step. We can begin our run session from a specific step in our test, or run the test until a specific step is reached. We can also set breakpoints to pause our test at predetermined points. We can view the value of variables in our test each time it stops at a breakpoint in the Debug Viewer.

3) To Update the Application: We can run our test using Update Run Mode to update the property sets used for test object descriptions, the expected checkpoint values, the data available to retrieve in output values, and the Active Screen images and values.

We can run our test using Maintenance Run Mode when we know that our application has changed, and we therefore expect that QTP will not be able to identify the objects in our test. When we run tests in Maintenance Run Mode, a wizard opens for steps that fail because an object could not be found in the application. The wizard then guides us through the steps of resolving the issue, and, after we resolve the issue, the run continues.

<<<<<< =================== >>>>>>

Q. 35: What are the main stages of Testing with QTP?

Testing with QTP involves main stages like:

1) Planning
2) Creating Tests
3) Running Tests
4) Analysing Results

<<<<<< =================== >>>>>>

Q. 36 : How can we do the Analysis of Results in QTP?

After we run our test, we can view the results.

# View the results in the Test Results window: After we run our test, we can view the results of the run in the Test Results window. We can view a summary of our results as well as a detailed report. If we had captured still images or movies of our application during the
run, we can view these from the Test Results window.

# Report defects detected during a run session: If we have access to Quality Center, the HP centralized quality solution, we can report the defects we discover to the project database. We can instruct QTP to automatically report each failed step in our test, or we can report them manually from the Test Results window.

<<<<<< =================== >>>>>>

Q. 37: What is Business Process Testing?

# Business Process Testing is a role-based testing model that enables Subject Matter Experts—who understand the various parts of the application being tested—to create business process tests in Quality Center. Automation Engineers—who are experts in QTP and automated testing—use QTP to define all of the resources and settings required to create business process tests.

# Business Process Testing uses a keyword-driven methodology for testing, based on the creation and implementation of business components and business process tests. A business component is an easily-maintained, reusable unit comprising one or more steps that perform a specific task within an application.

<<<<<< =================== >>>>>>

Q. 38: What are Permissions Required to Run QTP?

Following file system permissions are required:

1) Full read and write permissions for all the files and folders under the folder in which QTP is installed

2) Full read and write permissions to the Temp folder

3) Read permissions to the Windows folder and to the System folder

We must have the following registry key permissions:

1) Full read and write permissions to all the keys under HKEY_CURRENT_USER\Software\Mercury Interactive

2) Read and Query Value permissions to all the HKEY_LOCAL_MACHINE and HKEY_CLASSES_ROOT keys

<<<<<< =================== >>>>>>

Q. 39: What is the role of Keyword View in QTP?

The Keyword View enables us to create and view the steps of our test in a keyword-driven, modular, table format. The Keyword View is comprised of a table-like view, in which each step is a separate row in the table, and each column represents different parts of the steps. We can modify the columns displayed to suit our requirements.

We create and modify tests by selecting items and operations in the Keyword View and entering information as required. Each step is automatically documented as we complete it, enabling us to view a description of our test steps in understandable English.

Each operation performed on our application during a recording session is recorded as a row in the Keyword View.

<<<<<< =================== >>>>>>

Q. 40: What is the role of Expert View in QTP?

In the Expert View, QTP displays each operation performed on our application in the form of a script, comprised of VBScript statements. The Expert View is a script editor with many script editing capabilities. For each object and method in an Expert View statement, a corresponding row exists in the Keyword View. 

Q. 41: What are the various utilities and tools available in QTP?
Tools Menu contains the following utilities and tools which are helpful in the testing process:
# Action Conversion Tool: Enables us to convert test actions that were created using QTP to scripted components for use in business process testing.
# Additional Installation Requirements: Opens the Additional Installation Requirements dialog box, which displays any prerequisite software that we must install or configure to work with QTP.
# Business Component Upgrade Tool: Opens the Business Component Upgrade Tool. If we are connected to a Quality Center project, this tool enables us to upgrade all of the business components in a Quality Center project, from an earlier component version to the format required by the current version.
# HP Micro Player: Opens the HP Micro Player, which enables us to view captured movies of a run session without opening QuickTest.
# License Validation Utility: Opens the License Validation utility, which enables us to retrieve and validate license information.
# Password Encoder: Opens the Password Encoder dialog box, which enables us to encode passwords. We can use the resulting strings as method arguments or Data Table parameter values (tests only).
# QTP Script Editor: Opens the QTP Script Editor, which enables us to open and modify the scripts of multiple tests and function libraries, simultaneously.
# Register New Browser Control: Opens the Register Browser Control Utility, which enables us to register our browser control application so that QTP recognizes our Web object when recording or running tests.
# Remote Agent: Activates the QuickTest Remote Agent, which enables us to configure how QTP behaves when a test is run by a remote application such as Quality Center.
# Save and Restore Settings: Opens the Save and Restore Settings dialog box, which enables us to save our existing configurations before uninstalling an old version, and then restore them after installing a new version.
# Silent Test Runner: Opens the Silent Test Runner dialog box, which enables us to run a QTP test the way it is run from LoadRunner and Business Availability Center.
# Test Batch Runner: Opens the Test Batch Runner dialog box, which enables us to set up QTP to run several tests in succession.
# Test Results Deletion Tool: Opens the Test Results Deletion Tool dialog box, which enables us to delete unwanted or obsolete results from our system according to specific criteria that you define.
<<<<<< =================== >>>>>>
Q. 42: What is the concept of Test Object Model in QTP?
QTP tests our dynamically changing application by learning and identifying test objects and their expected properties and values. To do this, QTP analyzes each object in our application in much the same way that a person would look at a photograph and remember its details.
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 QuickTest can learn about it.
A test object is an object that QTP creates in the test to represent the actual object in your application. QTP stores information on the object that will help it identify and check the object during the run session.
A run-time object is the actual object in our application on which methods are performed during the run session.
<<<<<< =================== >>>>>>
Q. 43: Please explain some real world scenario explaining Object Learning process of QTP?
QTP learns objects just as we would. For example, suppose as part of an experiment, Bob is told that he will be shown a photograph of a picnic scene for a few seconds during which someone will point out one item in the picture. Bob is told that he will be expected to identify that item again in identical or similar pictures one week from today.
Before he is shown the photograph, Bob begins preparing himself for the test by thinking about which characteristics he wants to learn about the item that the tester indicates. Obviously, he will automatically note whether it is a person, inanimate object, animal, or plant. Then, if it is a person, he will try to commit to memory the gender, skin color, and age. If it is an animal, he will try to remember the type of animal, its color, and so forth.
The tester shows the scene to Bob and points out one of three children sitting on a picnic blanket. Bob notes that it is a Caucasian girl about 8 years old. In looking at the rest of the picture, however, he realizes that one of the other children in the picture could also fit that description. In addition to learning his planned list of characteristics, he also notes that the girl he is supposed to identify has long, brown hair.
Now that only one person in the picture fits the characteristics he learned, he is fairly sure that he will be able to identify the girl again, even if the scene the tester shows him next week is slightly different.
Since he still has a few moments left to look at the picture, he attempts to notice other, more subtle differences between the child he is supposed to remember and the others in the picture—just in case.
If the two similar children in the picture appeared to be identical twins, Bob might also take note of some less permanent feature of the child, such as the child’s position on the picnic blanket. That would enable him to identify the child if he were shown another picture in which the children were sitting on the blanket in the same order.
<<<<<< =================== >>>>>>
Q. 44: What is the method used by QTP to learn objects?
QTP "looks" at the object being learned and stores it as a test object, determining in which test object class it fits. In the same way, Bob immediately checked whether the item was a person, animal, plant, or inanimate object. QTP might classify the test object as a standard Windows dialog box, a Web button, or a Visual Basic scroll bar object, for example.
Then, for each test object class, QTP has a list of mandatory properties that it always learns; similar to the list of characteristics that Bob planned to learn before seeing the picture. When QTP learns an object, it always learns these default property values, and then "looks" at the rest of the objects on the page, dialog box, or other parent object to check whether this description is enough to uniquely identify the object. If it is not, QTP adds assistive properties, one by one, to the description, until it has compiled a unique description; similar to when Bob added the hair length and color characteristics to his list. If no assistive properties are available, or if those available are not sufficient to create a unique description, QTP adds a special ordinal identifier, such as the object’s location on the page or in the source code, to create a unique description.
<<<<<< =================== >>>>>>
Q. 45: What is Test Object Method in QTP?
It is a method that QTP recognizes as applicable to a particular test object. For example, the Click method is applicable to a WebButton test object. As we add steps to our test, we specify which method to perform on each test object. If we record steps, QTP records the relevant method as it is performed on an object.
During a run session, QTP performs the specified test object method on the run-time object. Run-time object methods are the methods of the object in our application as defined by the object creator. We can access and perform run-time object methods using the Object property.
<<<<<< =================== >>>>>>
Q. 46: What are the Test Object Properties in QTP?
Test object properties are the properties whose values are captured from the objects in our application when QTP learns the object. QTP uses the values of these properties to identify run-time objects in our application during a run session.
Property values of objects in our application may change dynamically each time our application opens, or based on certain conditions. We may need to modify the test object property values to match the run-time object property values. We can modify test object properties manually while designing our test, or use SetTOProperty statements during a run session.
<<<<<< =================== >>>>>>
Q. 47: How to decide on whether to save the objects in Local or Shared Object Repositories?
Local object repository is easiest to use when we are creating simple tests, especially under the following conditions:
# We have only one, or very few, tests that correspond to a given application, interface, or set of objects.
# We do not expect to frequently modify object properties.
# We generally create single-action tests.
Shared object repository is the preferred option when:
# We are creating tests using keyword-driven methodologies & not by recording.
# We have several tests that test elements of the same application, interface, or set of objects.
# We expect the object properties in our application to change from time to time and we regularly need to update or modify object properties.
# We often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.
<<<<<< =================== >>>>>>
Q. 48: What are the possibilities of Exporting the data among various Object Repositories?
When QTP learns a test object, it adds it to the local object repository & not to the shared object repository — unless the same test object already exists in an associated shared object repository. In this case, QTP uses the existing information in the shared object repository.
We can export objects from the local object repository to a shared object repository. We can also export the local object repository and replace it with a shared object repository. This enables us to make the local objects accessible to other actions.
We can also merge objects from the local object repository directly to a shared object repository that is associated with the same action. This can help reduce maintenance since we can maintain the objects in a single shared location, instead of multiple locations.
<<<<<< =================== >>>>>>
Q. 49: What is the effect of restoring Default Properties for a Test Object in QTP?
When we restore the default properties, it restores the mandatory property set defined for the selected object class in the Object Identification dialog box.
Any changes that we have made to the description property set for the test object will be overwritten. However, if property values were defined for any of the mandatory properties they are not modified.
<<<<<< =================== >>>>>>
Q. 50: What is the use of Ordinal Identifiers in QTP?
An ordinal identifier assigns a numerical value to a test object that indicates its order or location relative to other objects with an otherwise identical description for objects having the same values for all properties.
This ordered value provides a backup mechanism that enables QTP to create a unique description to recognize an object when the defined properties are not sufficient to do so. We can specify the ordinal identifier for test objects in the local object repository using the Object Repository window or Object Properties dialog box, and for test objects in the shared object repository using the Object Repository Manager.


Q. 51: What is the use of Mapping Repository Parameter Values in QTP?
We can map repository parameters that are used in shared object repositories that are associated with our action. Mapping a repository parameter to a value or parameter specifies the property values used to
identify the test object during a run session. We can specify that the property value is taken from a constant value, or parameterize it using a Data Table, random number, environment, or test parameter.
We can map each repository parameter as required in each test that has an associated object repository containing repository parameters.
If we do not map a repository parameter, the default value that was defined with the parameter, if any, is used during the action run. If the parameter is unmapped, meaning no default value was specified for it, the test run may fail if a test object cannot be identified because it has an unmapped parameter value.
<<<<<< =================== >>>>>>
Q. 52: What are the various Object Properties in QTP?
QTP has a predefined set of properties that it learns for each test object. If these mandatory property values are not sufficient to uniquely identify a learned object, QTP can add some assistive properties and an ordinal identifier to create a unique description.
Mandatory properties are properties that QTP always learns for a particular test object class.
Assistive properties are properties that QTP learns only if the mandatory properties that QTP learns for a particular object in our application are not sufficient to create a unique description. If several assistive properties are defined for an object class, then QTP learns one assistive property at a time, and stops as soon as it creates a unique description for the object. If QTP does learn assistive properties, those properties are added to the test object description.
<<<<<< =================== >>>>>>
Q. 53: What are the types of Ordinal Identifiers used by QTP to identify an object?
1) Index Property: It indicates the order in which the object appears in the application code relative to other objects with an otherwise identical description.
2) Location Property:It indicates the order in which the object appears within the parent window, frame, or dialog box relative to other objects with an otherwise identical description.
3) CreationTime Property: It is applicable for Browser Object only. It Indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description.
<<<<<< =================== >>>>>>
Q. 54: What is Index Property for Identifying the Objects in QTP?
While learning an object, QTP can assign a value to the test object’s Index property to uniquely identify the object. The value is based on the order in which the object appears within the source code. The first occurrence is 0.
Index property values are object-specific. Therefore, if we use Index:=3 to describe a WebEdit test object, QTP searches for the fourth WebEdit object in the page. However, if we use Index:=3 to describe a WebElement object, QTPt searches for the fourth Web object on the page - regardless of the type - because the WebElement object applies to all Web objects.
<<<<<< =================== >>>>>>
Q. 55: What is Location Property for Identifying the Objects in QTP?
While learning an object, QTP can assign a value to the test object’s Location property to uniquely identify the object. The value is based on the order in which the object appears within the window, frame, or dialog box, in relation to other objects with identical properties. The first occurrence of the object is 0. Values are assigned in columns from top to bottom, and left to right.
Location property values are object-specific. Therefore, if we use Location:=3 to describe a WinButton test object, QTP searches from top to bottom, and left to right for the fourth WinButton object in the page. However, if you use Location:=3 to describe a WinObject object, QTP searches from top to bottom, and left to right for the fourth standard object on the page - regardless of the type - because the WinObject object applies to all standard objects.
<<<<<< =================== >>>>>>
Q. 56: What is Creation Time Property for Identifying the Objects in QTP?
While learning a browser object, if QTP is unable to uniquely identify the object according to its test object description, it assigns a value to the CreationTime test object property. This value indicates the order in which the browser was opened relative to other open browsers with an otherwise identical description. The first browser that opens receives the value CreationTime = 0.
During the run session, if QTP is unable to identify a browser object based solely on its test object description, it examines the order in which the browsers were opened, and then uses the CreationTime property to identify the correct one.
For example, if we record a test on three otherwise identical browsers that are opened at 9:01 pm, 9:03 pm, and 9:05 pm, QTP assigns the CreationTime values, as follows: CreationTime = 0 to the 9:01 am browser, CreationTime = 1 to the 9:03 am browser, and CreationTime = 2 to the 9:06 am browser.
At 10:30 pm, when we run our test, suppose the browsers are opened at 10:31 pm, 10:33 pm, and 10:34 pm. QTP identifies the browsers, as follows: the 10:31 pm browser is identified with the browser test object with CreationTime = 0, 10:33 pm browser is identified with the test object with CreationTime = 1, 10:34 pm browser is identified with the test object with CreationTime = 2.

Q. 57: What is the Smart Identification Process of QTP
If QTP activates the Smart Identification mechanism during a run session, it follows the following process to identify the object:
1 QTP "forgets" the learned test object description and creates a new object candidate list containing the objects that match all of the properties defined in the Base Filter Properties list.
2 QTP filters out any object in the object candidate list that does not match the first property listed in the Optional Filter Properties list. The remaining objects become the new object candidate list.
3 QTP evaluates the new object candidate list:
# If the new object candidate list still has more than one object, QTP uses the new (smaller) object candidate list to repeat step 2 for the next optional filter property in the list.
# If the new object candidate list is empty, QTP ignores this optional filter property, returns to the previous object candidate list, and repeats step 2 for the next optional filter property in the list.
# If the object candidate list contains exactly one object, then QTP concludes that it has identified the object and performs the statement containing the object.
4 QTP continues the process described in steps 2 and 3 until it either identifies one object, or runs out of optional filter properties to use. If, after completing the Smart Identification elimination process, QTP still cannot identify the object, then QTP uses the learned description plus the ordinal identifier to identify the object. If the combined learned description and ordinal identifier are not sufficient to identify the object, then QTP stops the run session and displays a Run Error message.
<<<<<< =================== >>>>>>
Q. 58: What happens in case Smart Identification fails to identify the object in QTP?
If the Smart Identification mechanism cannot successfully identify the object, QTP uses the learned description plus the ordinal identifier to identify the object.
If the object is still not identified, the test fails and a normal failed step is displayed in the results.
<<<<<< =================== >>>>>>
Q. 59: What is the use of Repository Parameters in QTP?
Repository parameters enable us to specify that certain property values should be parameterized, but leave the actual parameterization to be defined in each test that is associated with the object repository that contains the parameterized test object property values.
Repository parameters are useful when we want to create and run tests on an object that changes dynamically. An object may change dynamically if it is frequently updated in the application, or if its property values are set using dynamic content, for example, from a database.
<<<<<< =================== >>>>>>
Q. 60: How can we locate Test Objects in an Object Repository?
We can search for a specific test object in our object repository in many ways.
We can search for a test object according to its type. For example, we can search for a specific edit box, or we can point to an object in our application to automatically highlight that same object in our repository.
We can replace specific property values with other property values. For example, we can replace a property value userName with the value user name.
We can also select an object in our object repository and highlight it in our application to check which object it is.
After making sure that we shared object repository is the active window, we locate an object in a shared object repository in the same way as we locate it in a local object repository. If we want to replace property values, we must also make sure that the object repository is editable.
Q. 61: How can we perform Merge Operations among various Object Repositories?
The Object Repository Merge Tool enables us to merge test objects from the local object repository of one or more actions to a shared object repository using the Update from Local Repository option in the Object Repository Manager.
For example, we may have learned test objects locally in a specific action in our test and want to add them to the shared object repository so they are available to all actions in different tests that use that object repository. We can also use the Object Repository Merge Tool to merge two shared object repositories into a single shared object repository.
We open the Object Repository Merge Tool by choosing Tools > Object Repository Merge Tool in the Object Repository Manager.
<<<<<< =================== >>>>>>
Q. 62: How can we perform Import & Export Operations among various Object Repositories?
We can import and export object repositories from and to XML files. XML provides a structured, accessible format that enables us to make changes to object repositories using the XML editor of our choice and then import them back into QTP.
We can import and export files either from and to the file system or a Quality Center project.
We can import an XML file as an object repository. The XML file can either be an object repository that we exported to XML format using the Object Repository Manager, or an XML file created using a tool such as QTP Siebel Test Express or a custom built utility. We must adhere to the XML structure and format.
<<<<<< =================== >>>>>>
Q. 63: How can we Integrate QTP with Quality Center?
We integrate QTP with Quality Center using the Quality Center Connectivity Add-in. This add-in is installed on our QTP computer automatically when we connect QTP to Quality Center using the Quality Center Connection dialog box. We can also install it manually from the Quality Center Add-ins page (available from the Quality Center main screen) by choosing Quality Center Connectivity.
Integrating QTP with Quality Center enables us to store and access QTP tests and function libraries in a Quality Center project, when QTP is connected to Quality Center.
<<<<<< =================== >>>>>>
Q. 64: What is the use of Template Tests in QTP?
Template tests serve as the basis for all QTP tests created in Quality Center. A template test is a QTP test that contains default test settings. For example, a template test might specify the QTP add-ins, associated function libraries, and recovery scenarios that are associated with a test. We can modify these test settings in the Test Settings dialog box (File > Settings) in QTP.
In addition to default test settings, a template test can also contain any comments or steps we want to include with all new QTP tests created in Quality Center. For example, we may want to add a comment notifying users which add-ins are associated with the template test, or we may want to add a step that opens a specific Web page or application at the beginning of every test. Any steps or comments we add to a template test are included in all new tests created in Quality Center that are based on that template test.
<<<<<< =================== >>>>>>
Q. 65: How can we create a QTP Test in Quality Center?
In Quality Center, we create QTP tests in the Test Plan module. When you create a QTP test, we apply a template test to it. We can choose either the default template test stored on our QTP client, or a template test that is saved in our Quality Center project.
If we do not have any template tests saved in our Quality Center project, or if we choose in the Template box, Quality Center uses the settings defined in the template test that was installed with the QTP Add-in for Quality Center on our Quality Center client.
<<<<<< =================== >>>>>>
Q. 66: What is Business Process Testing Model?
The Business Process Testing model is role-based, allowing non-technical Experts working in Quality Center to collaborate effectively with Automation Engineers working in QTP.
Non-technical Subject Matter Experts define and document business processes, business components, and business process tests, while Automation Engineers define the required resources and settings, such as shared object repositories, function libraries, and recovery scenarios. Together, they can build, data-drive, document, and run business process tests, without requiring programming knowledge on the part of the Non-technical Subject Matter Expert.
<<<<<< =================== >>>>>>
Q. 67: What is the role of Subject Matter Expert in the Business Process Testing Model?
The Subject Matter Expert has specific knowledge of the application logic, a high-level understanding of the entire system, and a detailed understanding of the individual elements and tasks that are fundamental to the application being tested.
This enables the Subject Matter Expert to determine the operating scenarios or business processes that must be tested and identify the key business activities that are common to multiple business processes.
During the design phase, the Subject Matter Expert works with the Automation Engineer to identify the resources and settings needed to automate the components, enabling the Automation Engineer to prepare them.
The Subject Matter Expert configures the values used for business process tests, runs them in test sets, and reviews the results. The Subject Matter Expert is also responsible for maintaining the testing steps for each of the individual business components.
While defining components, Subject Matter Experts continue collaborating with the Automation Engineer.
<<<<<< =================== >>>>>>
Q. 68: What is the role of Automation Engineer in the Business Process Testing Model?
The Automation Engineer is an expert in using an automated testing tool, such as QTP. The Automation Engineer works with the Subject Matter Expert to identify the resources that are needed for the various business process tests.
The Automation Engineer then prepares the resources and settings required for testing the features associated with each specific component, and stores them in an application area within the same Quality Center project used by the Subject Matter Experts who create and run the business process tests for the specific application.
The Automation Engineer uses QTP features and functionality to create these resources from within QTP.
<<<<<< =================== >>>>>>
Q. 69: What are the Differences Between Components and Tests?
# A component is a single entity. It cannot contain multiple actions or have calls to other actions or to other components.
# When working with components, all external files are stored in the Quality Center project to which we are currently connected.
# The name of the component node in the Keyword View is the same as the saved component. We cannot rename the node.
# Business components are created in the Keyword View, not the Expert View.
# We add resources via the component’s application area, and not directly to the component.
# Components use custom keywords created in function libraries to perform operations, such as verifying property values and opening the application we are testing.
<<<<<< =================== >>>>>>
Q. 70: How can we compare objects among two object repositories?
In QTP, we can compare existing assets from two object repositories using the Object Repository Comparison Tool.
The tool is accessible from the Object Repository Manager, and enables us to compare different object repository resources, or different versions of the same object repository resource, and identify similarities, variations, or changes.
Differences between objects in the two object repository files, named the First and Second files, are identified according to default rules. During the comparison process, the object repository files remain unchanged.
After the compare process, the Comparison Tool provides a graphic presentation of the objects in the object repositories, which are shown as nodes in a hierarchy.
Q. 71: What are the various types of objects identified by the comparison tool in QTP?
1) Identical: Objects that appear in both object repository files. There is no difference in their name or in their properties.
2) Matching description, different name: Objects that appear in both object repository files that have different names, but the same description properties and values.
3) Similar description: Objects that appear in both object repository files that have similar, but not identical, description properties and values. One of the objects always has a subset of the properties set of the other object. This implies that it is likely to be a less detailed description of the same object. For example, an object named Button_1 in the second object repository has the same description properties and values as an object named Button_1 in the first object repository, but also has additional properties and values.
Objects that do not have a description, such as Page or Browser objects, are compared by name only. If the same object is contained in both the object repositories but with different names, they will be shown in the object repositories as two separate objects.
4) Unique to first file, or Unique to second file. Objects that appear in only one of the object repository files.
<<<<<< =================== >>>>>>
Q. 72: What are the situations best suited to Recording in QTP?
Recording can be useful in the following situations:
# Recording helps novice QTP users learn how QTP interprets the operations we perform on our application, and how it converts them to QTP objects and built-in operations.
# Recording can be useful for more advanced QTP users when working with a new application or major new features of an existing application. Recording is also helpful while developing functions that incorporate built-in QTP keywords.
# Recording can be useful when we need to quickly create a test that tests the basic functionality of an application or feature, but does not require long-term maintenance.
<<<<<< =================== >>>>>>
Q. 73: What are the advantages of Keyword Driven testing in QTP?
1) Keyword-driven testing enables us to design our tests at a business level rather than at the object level.
2) By incorporating technical operations, such as a synchronization statement that waits for client-server communications to finish, into higher level keywords, tests are easier to read and easier for less technical application testers to maintain when the application changes.
3) Keyword-driven testing naturally leads to a more efficient separation between resource maintenance and test maintenance. This enables the automation experts to focus on maintaining objects and functions while application testers focus on maintaining the test structure and design.
4) When we record tests, we may not notice that new objects are being added to the local object repository. This may result in many testers maintaining local object repositories with copies of the same objects. When using a keyword-driven methodology, we select the objects for our steps from the existing object repository. When we need a new object, we can add it to our local object repository temporarily, but we are also aware that we need to add it to the shared object repository for future use.
<<<<<< =================== >>>>>>
Q. 74: What are Absolute and Relative Paths in QTP?
We can save QTP resources, such as shared object repositories, function libraries, recovery scenarios or environments, using absolute or relative paths.
1) An absolute path: Describes the full path to a specific file starting from a fixed location such as the root directory, or the drive on which the file is located, and contains all the other sub-directories in the path. An absolute path always points to the specified file, regardless of the current directory.
2) A relative path: Describes the path to a specific file starting from a given directory, and is generally only a portion of the absolute path. A relative path therefore specifies the location of the file relative to the given location in the file system.
Using relative paths means that the paths remain valid when files or folders containing files are moved or copied to other locations or computers, provided that they are moved within the same folder structure. For this reason, we recommend that we use relative paths when saving resources in QTP.
<<<<<< =================== >>>>>>
Q. 75: What are the situations best suited to Keyword-driven methodology in QTP?
The keyword-driven methodology is especially useful for organizations that have both technical and less technical users because it offers a clear division of automation tasks. This enables a few experts to maintain the resource framework while less technical users design and maintain automated test steps. Additionally, once the basic infrastructure is in place, both types of users can often do their tasks simultaneously.
<<<<<< =================== >>>>>>
Q. 76: What are the steps for implementing tests with Keyword Driven Methodology?
Step 1: Analyze the application to find out the testing needs: In this step, weu determine our application’s development environment, such as Web, Java, or .NET, so that we can load the required QTP add-ins. We also find out the business processes and functionality we want to test.
Step 2: Set up object repositories: After we decide what we want to test and how to divide our actions, we build the set of resources to be used by our tests. The most widely used resource is the shared object repository.
Step 3: Create function libraries: After we create our object repositories, we create function libraries containing functions that extend QTP functionality. Application testers can use these keywords to build keyword-driven tests.
Step 4: Configure QTP according to our testing needs: Here we set up the global testing preferences, run session preferences, and any test-specific preferences. If needed, we can create recovery scenarios that instruct QTP how to proceed when a step fails. We also configure the QTP window so that we can easily access any needed panes, such as the Test Flow pane, the Resources pane, and the Available Keywords pane.
Step 5: Build the tests: We now construct our tests by inserting calls to the relevant actions from our tests. Ccreate one or more empty tests and add actions to them. Make sure that we associate our object repositories with the relevant actions, and associate our function libraries and recovery scenarios with the relevant tests, so that we can insert steps using keywords. We may also need to configure test preferences at this point.
Step 6: Add steps to the test actions: Add steps that use the keywords we created in previous steps. We can then enhance our tests by inserting checkpoints and output values to verify that our application is behaving according to expectations. We can add programmatic statements to further enhance our tests.
Step 7: Run, analyze, and troubleshoot our tests: When our tests are ready, we run them, view the run results, and troubleshoot our tests, as needed.
<<<<<< =================== >>>>>>
Q. 77: How do we analyze our application to determine our testing needs using QTP?
1) Determine the development environments that QuickTest needs to support: Our application comprises of windows containing a hierarchy of objects that were created in one or more development environments. QTP provides support for these environments using add-ins. We load QTP add-ins when QTP opens by using the Add-in Manager dialog box. We can check which add-ins are loaded by choosing Help > About QTP.
2) Prepare the information that QTP needs to identify objects in our application and to open our application at the beginning of a run session. We need to know the URL, the executable file name and path, or other command-line information. Later, we will enter this in Record and Run Settings dialog box.
3) Navigate through our application from a cusf nr5tomer’s perspective and perform the tasks that customers might perform. We create an action for each sub-process, or task, a customer might perform. Each process we perform in our application will be represented as a test in QTP. We can create our tests now.
<<<<<< =================== >>>>>>
Q. 78: In what situations recording mechanism shall be useful in creating tests in QTP?
1) We are new to QTP and want to learn how QTP interprets the operations we perform on our application and how it converts them to QTP objects and built-in operations.
2) We need to quickly create a test that tests the basic functionality of an application or feature, and the test does not require long-term maintenance.
3) We are working with a new application or with major new features of an existing application, and we want to learn how QTP interacts with the application.
4) We are developing functions that incorporate built-in QTP keywords.
<<<<<< =================== >>>>>>
Q. 79: What are the various Recording Modes in QTP?
1) Normal or the default recording mode: This records the objects in our application and the operations performed on them. This mode takes full advantage of the QTP object model, recognizing the objects in our application regardless of their location on the screen.
2) Analog Recording: This enables us to record the exact mouse and keyboard operations we perform in relation to either the screen or the application window. In this recording mode, QTP records and tracks every movement of the mouse as we drag the mouse around a screen or window.
3) Low Level Recording:This enables us to record on any object in our application, whether or not QTP recognizes the specific object or the specific operation. This mode records at the object level and records all run-time objects as Window or WinObject test objects.
<<<<<< =================== >>>>>>
Q. 80: How can we switch to Low Level Recording mode while editing a test?
We can switch to Low Level Recording mode only while recording a test. The option is not available while editing a test.
Q. 81: What is the use of Keyword View in QTP?
The Keyword View enables us to create and view the steps of our test in a modular, table format.
Each step is a row in the Keyword View that is comprised of individual, modifiable parts. We create and modify steps by selecting items and operations in the Keyword View and entering information as required. Each step is automatically documented as we complete it, enabling us to view a description of our test in understandable sentences.
<<<<<< =================== >>>>>>
Q. 82: What are Conditional and Loop Statements used in the Keyword View in QTP?
Using conditional statements, we can incorporate decision making into the tests. Using loop statements, we can run a group of steps repeatedly, either while or until a condition is true. We can also use loop statements to repeat a group of steps a specific number of times. A few conditional & Loop statements are given below:
1) If...Then statement
2) ElseIf...Then statement
3) Else statement
4) While...Wend statement
5) For...Next statement
6) Do...While statement
7) Do...Until statement
<<<<<< =================== >>>>>>
Q. 83: What is the use of a Comment in the Comment cell of a step in QTP?
A Comment is free text entry which can help improve readability and make a test easier to update. For example, we may want to add a comment step at the beginning of each action to specify what that section includes.
QTP does not process comments when it runs a test.
<<<<<< =================== >>>>>>
Q. 84: What are Nesting Actions & what is the use of them?
Sometimes we may want to call an action from within an action. This is called nesting. By nesting actions, you can:
1) Maintain the modularity of your test.
2) Run one or more actions based on the results of a conditional statement.
<<<<<< =================== >>>>>>
Q. 85: Splitting Actions option is not available under what circumstances in QTP?
You cannot split an action, and the option is disabled when:
1) An external action is selected
2) The first step of an action is selected
3) We are working with a read-only test
4) Recording a test
5) Running a test
<<<<<< =================== >>>>>>
Q. 86: What is the use of Action Parameters in QTP?
Action parameters enable us to transfer input values from our test to a top-level action, from a parent action to a nested action, or from an action to a sibling action that occurs later in the test.
We can use action parameters in any step in our action including function calls.
<<<<<< =================== >>>>>>
Q. 87: What are the various types of Exit Action Statements in QTP?
There are four types of exit action statements we can use:
1) ExitAction: Exits the current action, regardless of its iteration attributes.
2) ExitActionIteration: Exits the current iteration of the action.
3) ExitRun: Exits the test, regardless of its iteration attributes.
4) ExitGlobalIteration: Exits the current global iteration.
<<<<<< =================== >>>>>>
Q. 88: What is the use of Checkpoints in QTP?
A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. This enables us to identify whether our application is functioning correctly.
When we run the test, QTP compares the expected results of the checkpoint to the current results. If the results do not match, the checkpoint fails. We can view the results of the checkpoint in the Test Results window.
<<<<<< =================== >>>>>>
Q. 89: What are the situations best suited for using an existing Checkpoint?
1) If each page of our application contains our organization’s logo, we can reuse a bitmap checkpoint to verify each occurrence in the application.
2) If our application contains multiple edit boxes, we can reuse a checkpoint to confirm the enabled status of these edit boxes throughout our test.
<<<<<< =================== >>>>>>
Q. 90: What is the reason that "Add Existing Checkpoint" dialog box is not visible?
"Add Existing Checkpoint" dialog box option is available only if at least one of the object repositories associated with the current action (including the local object repository) contains at least one checkpoint.
Q. 91: What is a Standard Check Point in QTP?
It is a checkpoint which checks the property value of an object in our application. The standard checkpoint checks a variety of objects such as buttons, radio buttons, combo boxes, lists, and so forth. For example, we can check that a radio button is activated after it is selected or we can check the value of an edit box.
Standard checkpoints are supported for all add-in environments.
<<<<<< =================== >>>>>>
Q. 92: What is a Image Check Point in QTP?
It is a checkpoint ahich checks the value of an image in our application. For example, we can check that a selected image’s source file is correct. Image checkpoint is created by inserting a standard checkpoint on an image object.
Image checkpoints are supported for the Web add-in environment.
<<<<<< =================== >>>>>>
Q. 93: What is a Bitmap Check Point in QTP?
It is a checkpoint which checks an area of our application as a bitmap. For example, suppose we have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. We can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, we can check that the map zooms in correctly.
We can create a bitmap checkpoint for any area in our application, including buttons, text boxes, and tables.
Bitmap checkpoints are supported for all add-in environments
<<<<<< =================== >>>>>>
Q. 94: What is a Table Check Point in QTP?
It is a checkpoint which checks information within a table. For example, suppose our application contains a table listing all available flights from New Delhi to Chennai. We can add a table checkpoint to check that the time of the first flight in the table is correct.
We create a table checkpoint by inserting a standard checkpoint on a table object.
Table checkpoints are supported for Web, ActiveX, Java, Oracle, and .NET Windows Forms environments, as well as other add-in environments
<<<<<< =================== >>>>>>
Q. 95: What is a Text Check Point in QTP?
It is a checkpoint which 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 Delhi to Chennai. We can create a text checkpoint that checks that the words "New Delhi" are displayed between "Flight departing from" and "to Chennai".
Text checkpoints are supported for most add-in environments
<<<<<< =================== >>>>>>
Q. 96: What is a Text Area Check Point in QTP?
It is a checkpoint which checks that a text string is displayed within a defined area in a Windows-based application, according to specified criteria. For example, suppose our Visual Basic application has a button that says View Doc , where is replaced by the four digit code entered in a form elsewhere in the application. We 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
<<<<<< =================== >>>>>>
Q. 97: What is an Accessibility Check Point in QTP?
It is a checkpoint which identifies areas of our 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 us to provide a text equivalent for every non-text element. We 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.
<<<<<< =================== >>>>>>
Q. 98: What is a Page Check Point in QTP?
It is a checkpoint checks the characteristics of a Web page. For example, we can check how long a Web page takes to load or whether a Web page contains broken links.
We create a page checkpoint by inserting a standard checkpoint on a page object. Page checkpoints are supported for the Web add-in environment.
<<<<<< =================== >>>>>>
Q. 99: What is a Database Check Point in QTP?
It is a checkpoint which checks the contents of a database accessed by our application. For example, we can use a database checkpoint to check the contents of a database containing flight information for our Web site.
Database checkpoints are supported for all add-in environments
<<<<<< =================== >>>>>>
Q. 100: What is a XML Check Point in QTP?
It is a checkpoint which checks the data content of XML documents in XML files or XML documents in Web pages and frames. The XML Checkpoint option is supported for the Web add-in environment & for all add-in environments.


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.
Q. 111: How can we check the location of a cell to be checked in a Row of a table?
By the use of Identify columns option available in Cell Identification tab. This specifies the location of the row containing the cells with which you want to compare the expected data. This is done in two ways:
1) By row number: This is the Default option. It locates cells according to the row position. A shift in the position of any of the rows within the table results in a mismatch.
2) By selected key columns: It locates the rows containing the cells to be checked by matching the value of the cell whose column was previously selected as a key column. A shift in the position of the row does not result in a mismatch. If more than one row is identified, QTP checks the first matching row. We can use more than one key column to uniquely identify any row.
<<<<<< =================== >>>>>>
Q. 112: How can we ensure that a text string appears in a specified area in QTP?
With the help of Text Area Checkpoint, we can ensure that a particular text string appears within a defined area in a Windows application, according to the specified criteria. It is supported for a variety of QTP add-in environments, like Standard Windows, Java, Visual Basic, and ActiveX etc.
<<<<<< =================== >>>>>>
Q. 113: How QTP retrieves Text while checking the text during the test?
QTP tries to retrieve the text directly from the object. If QTP cannot retrieve the text in this manner in some case where the text happens to be the part of a picture, it tries to retrieve the text using an OCR commonly known as optical character recognition mechanism.
<<<<<< =================== >>>>>>
Q. 114: How can we check the databases accessed by our application in QTP?
We can use database checkpoints to check the databases accessed by your application. For this, we define a query on the database. Then we create a database checkpoint for checking the results of the query. A database query can be defined in two ways like:
1) By Microsoft Query: We can install Microsoft Query from the custom installation of the Microsoft Office.
2) By manually defining an SQL statement.
<<<<<< =================== >>>>>>
Q. 115: How can we check a current data value with a value stored in a database in QTP?
With the help of database checkpoint we can check a current data value with a value stored in the database. When we run the test, the database checkpoint compares the current data in the database to the expected data defined in the Database Checkpoint Properties dialog box. If the expected data and the current results do not match, the database checkpoint fails.
<<<<<< =================== >>>>>>
Q. 116: What is the maximum number of rows, which can be defined in a database in QTP?
We can specify a maximum of 32,000 rows.
<<<<<< =================== >>>>>>
Q. 117: What is XML?
XML also called as Extensible Markup Language is a meta-markup language for text documents. This is recognized as a standard by the World Wide Web Consortium or called W3C in short. XML makes the complex data structures portable between different computer environments and programming languages, facilitating the sharing of data.
XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data.
<<<<<< =================== >>>>>>
Q. 118: How can we verify the data content of XML files?
With the help of XML checkpoints, we can verify the data content of XML files. Common uses of XML checkpoints are:
1) We can validate that the data has not changed from one application release to the other.
2) We can check the content of an element to make sure that its tags, attributes, and values have not changed.
3) We can verify that the web service returns the XML in the expected structure and with the expected values.
<<<<<< =================== >>>>>>
Q. 119: What are the various types of XML checkpoints in QTP?
We can create three types of XML checkpoints in QTP:
1) XML Web Page / Frame Checkpoint: This checks an XML document within a Web page or frame.
2) XML File Checkpoint: This checks a specified XML file.
3) XML Test Object Checkpoint: This checks the XML data for an object or operation.
<<<<<< =================== >>>>>>
Q. 120: What is the use of XML Checkpoints on Web service operations?
XML Checkpoints on Web service operations compare the expected values of the checkpoint to the actual values returned from the last native Web service operation performed on the test object.
If a different Web service operation step is performed prior to the checkpoint, then the checkpoint will fail.
Q. 121: What is the use of XML Tree?
XML tree displays the hierarchical relationship between each element and value in the XML tree, enabling us to select the specific elements, attributes and values we want to check. Each element is displayed with a (X) icon. Each value is displayed with a (V) icon.
<<<<<< =================== >>>>>>
Q. 122: How many types of element checks are available in XML Checkpoints in QTP?
1) Check number of attributes: It checks the number of attributes that are attached to the element.
2) Check number of child element occurrences in block: Displays the number of child elements associated with the selected parent element. If we select this option, QTP verifies that the number of child elements in your XML tree corresponds to the number that appears in the Check number of child element occurrences in block field.
<<<<<< =================== >>>>>>
Q. 123: What is Schema Validation?
We can activate Schema Validation button to confirm that the XML in our application or file adheres to the structure defined in a specific XML schema or schemas. We can validate the structure of the XML we are checking using one or more external schema files or using schema embedded within our XML document.
<<<<<< =================== >>>>>>
Q. 124: What are the methods to populate the XML Tree?
We can use any one of the following three methods to populate the XML tree:
1) Updating the XML Tree Manually
2) Importing an XML Tree from a File
3) Updating the XML Tree Using Update Run Mode
<<<<<< =================== >>>>>>
Q. 125: What are the special guidelines for Schema Validation?
We consider following guidelines when specifying a schema file to validate our XML.
1) If we are validating an XML file using a schema defined in the XML file, the schema can be defined with an absolute or relative path. When we specify a relative path, QTP searches for the schema in the folders listed in the Folders tab of the Options dialog box.
2) If we are validating an XML document located on the Web with a schema file located on our file system, we cannot use UNC format (for example, \\ComputerName\Path\To\Schema) to specify the schema file location. Instead, map the schema file location to a network drive.
3) If there is a schema with a namespace defined in our XML document, the namespace of the external schema must be identical to the one defined in our document.
4) When we perform a schema validation, QTP validates all of the elements in the XML document, even if certain XML elements are not associated with a schema file. Any XML elements that are not associated with a schema file will cause the schema validation to fail.
<<<<<< =================== >>>>>>


No comments:

Post a Comment