Pages

Thursday, 9 February 2012

HP QTP - QuickTest Prof. 10.0 Question Bank - Part 1

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.

0 comments:

Post a Comment