Total Pageviews

Wednesday, October 13, 2010

QTP Interview Questions with Answers part 5


1.     How QTP retrieves Text while checking the text during the test?

You can check that a specified text string is displayed by adding one of the following checkpoints to your test.

* Standard Checkpoint. Enables you to check the text property of an object. You can use standard checkpoints to check text in Windows-based and other types of applications (including Web-based applications).
* Text Area Checkpoint. Enables you to check that a text string appears within a defined area in a Windows application, according to specified criteria. It is supported for Standard Windows, Visual Basic, and ActiveX environments. Text area checkpoints are also supported for various external QTP Professional add-ins. Refer to your add-in documentation for details.
* Text Checkpoint. Enables you to check that the text is displayed in a screen, window, or Web page, according to specified criteria. Text checkpoints are supported for many add-in environments (as listed in Supported Checkpoints). Text checkpoints are also supported for various external QTP Professional add-ins. Refer to your add-in documentation for details.

When checking text, QTP tries to retrieve the text directly from the test object. If QTP cannot retrieve the text (for example, because the text is part of a picture), it tries to retrieve the text using an OCR (optical character
recognition) mechanism.


2.     How results are generated in QTP?

When a run session ends, you can view the run session results in the Test Results window. By default, the Test Results window opens automatically at the end of a run. If you want to change this behavior, clear the View results when run session ends check box in the Run tab of the Options dialog box.

The Test Results window contains a description of the steps performed during the run session. For a test that does not contain Data Table parameters, the Test Results window shows a single test iteration.

If the test contains Data Table parameters, and the test settings are configured to run multiple iterations, the Test Results window displays details for each iteration of the test run. The results are grouped by the actions in the test.

Note: You set the test to run for one or all iterations in the Run tab of the Test Settings dialog box.

After you run a test, the Test Results window displays all aspects of the run session, including:

* a high-level results overview report (pass/fail status)
* the data used in all runs
* an expandable tree of the steps, specifying exactly where application failures occurred
* the exact locations in the test where failures occurred
* a still image of the state of your application at a particular step
* a movie clip of the state of your application at a particular step or of the entire test
* detailed explanations of each step and checkpoint pass or failure, at each stage of the test

Note: The Test Results window can show results with up to 300 levels in the tree hierarchy. If you have results with more than 300 nested levels, you can view the entire report by manually opening the results.xml file.



3.     How the output values are stored during the run sessions in QTP?

When you define an output value, you can specify where and how each value is stored during the run session.

You can output a value to:

* a test or action parameter
* the run-time Data Table
* an environment variable

Note: Output values are stored only for the duration of the test, and are not saved with the test. If you select to output a value to an existing parameter, Data Table column, or environment variable, the existing value is overwritten when the output value step runs. When the run session ends, the original value is restored.





4.     How to use Environment Variable Files with Quality Center?

When working with Quality Center and environment variable files, you must save the environment variable file as an attachment in your Quality Center project before you specify the file in the Environment tab of the Test Settings dialog box.

You can add a new or an existing environment variable file to your Quality Center project. Note that adding an existing file from the file system to a Quality Center project creates a copy of the file in Quality Center. Thus, once you save the file to the project, changes made to the Quality Center environment variable file will not affect the file system file and vice versa.
http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx

To use an environment variable file with Quality Center:

1. To add a new environment variable file, create a new .xml file in your file system.
2. In Quality Center, add the file to the project as an attachment. For more information, refer to your Quality Center documentation.
3. In QTP, connect to the Quality Center project.
4. In the Test Settings dialog box, click the Environment tab.
5. Select User-defined from the Variables type list.
6. Select Load variables and values from external file (reload each run session).
7. In the File box, click the browse button to find the user-defined variable file in the Quality Center project.
8. Save your test. QTP saves the file to the Quality Center project.



5.     Does QTP work with COM?

QTP complies with the COM standard.

QTP supports COM objects embedded in Web pages (which are currently accessible only using Microsoft Internet Explorer) and you can drive COM objects in VBScript.




6.     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.

The Step Generator enables you to add steps by selecting from a range of context-sensitive options and entering the required values. In the Step Generator dialog box you can define steps that use:

* test object methods and properties (tests only)
* Utility object methods and properties
* calls to library functions (tests only), VBScript functions, and internal script functions

For example, you can add a step that checks that an object exists, or that stores the returned value of a method as an output value or as part of a conditional statement. You can parameterize any of the values in your step.

Note: You can use the Step Generator to insert steps in tests and function libraries. However, in function libraries, you cannot use the Step Generator to access test object names or collections, or to access the list of library functions.

Before you open the Step Generator to define a new step, you first select where in your test the new step should be inserted.

After you open the Step Generator, you first select the category for the step operation (test object, Utility object or function) and the required object or the function library source (for example, built-in or local script functions). You can then select the appropriate method or function and define the arguments and return values, parameterizing them if required.

The Step Generator then inserts a step with the correct syntax into your test. You can continue to add further steps at the same location without closing the Step Generator.

You can open the Step Generator from the Keyword View or Expert View while recording or editing your test. You can also open the Step Generator from the Active Screen while editing.

http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx

7.      Please explain some real world scenario explaining Object Learning process of QTP?

QTP learns objects just as you would. For example, suppose as part of an experiment, Alex 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. Alex 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, Alex 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 Alex and points out one of three children sitting on a picnic blanket. Alex 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, Alex 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.

QTP uses a very similar method when it learns objects during the recording process.

First, it "looks" at the object on which you are recording and stores it as a test object, determining in which test object class it fits. Just as Alex immediately checked whether the item was a person, animal, plant, or thing. QTP might classify the test object as a standard Windows dialog box (Dialog), a Web button (WebButton), or a Visual Basic scroll bar object (VbScrollBar), 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 Alex planned to learn before seeing the picture. When you record on an object, QTP 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; like when Alex 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, just as Alex would have remembered the child's position on the picnic blanket if two of the children in the picture had been identical twins.

8.     Splitting Actions option is not available under what circumstances in QTP?

You can split an action that is stored with your test into two sibling actions or into parent-child nested actions. When you split an action, the second action starts with the step that is selected when you perform the split action operation.

You cannot split an action and the option is disabled when:

* an external action is selected
* the first step of an action is selected
* recording a test
* running a test
* you are working with a read-only test

9.     What are Absolute and Relative Paths in QTP?

absolute path: It means Direct path,
relative Path: It means indirect path

You 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.

so u can do it in two ways :
1.absolute path : C:\more\mna\users\bsp\hello.txt
so absolute path means full path of file or directory starting with "/" root of directory structure

2.relative path : users\bsp\hello.txt

10.   Does QTP work with XML?

XML is eXtensible Markup Language, a pared-down version of SGML for Web documents, that enables Web designers to create their own customized tags. QTP supports XML and recognizes XML tags as objects. QTP also supports XML output and schema validation.

By adding XML checkpoints in QTP to your test scripts, you can check the contents of individual XML data files or documents that are part of your Web application.


11.    What are Conditional and Loop Statements used in the Keyword View in QTP?

Using conditional statements, you can incorporate decision making into your tests. Using loop statements, you can run a group of steps repeatedly, either while or until a condition is true. You can also use loop statements to repeat a group of steps a specific number of times. Each statement type is indicated by one of the following icons in the Keyword View:

After you insert a conditional or loop statement in the Keyword View, you can insert or record steps after the statement to include them in the conditional or loop block.



12.   What are Data Tables in QTP?

The data your test uses is stored in the design-time Data Table, which is displayed in the Data Table pane at the bottom of the screen while you insert and edit steps.

The Data Table has the characteristics of a Microsoft Excel spreadsheet, meaning that you can store and use data in its cells and you can also perform mathematical formulas within the cells. You can use the DataTable, DTSheet and DTParameter utility objects to manipulate the data in any cell in the Data Table.

Note: The use of complex and/or nested formulas in the Data Table is not supported.

You can insert Data Table parameters and output values into your test. Using Data Table parameters and/or output values in a test enables you to create a data-driven test or action that runs several times using the data you supply. In each repetition, or iteration, QTP uses a different value from the Data Table.

During the run session, QTP creates a run-time Data Table—a live version of the Data Table associated with your test. During the run session, QTP displays the run-time data in the Data Table pane so that you can see any changes to the Data Table as they occur.

When the run session ends, the run-time 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 is not saved with the test. The final data from the run-time Data Table is displayed in the Run-Time Data Table in the Test Results window.

Tip: If it is important for you to save the resulting data from the run-time Data Table, you can insert a DataTable.Export statement to the end of your test to export the run-time Data Table to a file. You can then import the data to the design-time Data Table using the Data Table File > Import From File menu. Alternatively you can add a DataTable.Import statement to the beginning of your test to import the run-time Data Table that was exported at the end of the previous run session.

13.   What are Nesting Actions in QTP & what is the use of them?

Sometimes you may want to call an action from within an action. This is called nesting. By nesting actions, you can:

* Maintain the modularity of your test.
* Run one or more actions based on the results of a conditional statement.

For example, suppose you have parameterized a step where a user selects one of three membership types as part of a registration process. When the user selects a membership type, the page that opens depends on the membership type selected in the previous page. You can create one action for each type of membership. Then you can use If statements to determine which membership type was selected in a particular iteration of the test and run the appropriate action for that selection.



14.   What are Object Repositories in QTP?

When QTP runs a test, it simulates a human user by moving the pointer over the application, clicking objects, and entering keyboard input. Like a human user, QTP must learn the interface of an application to be able to work with it. QTP does this by learning the application's objects and their corresponding property values and storing these object descriptions in an object repository.

As QTP learns the test objects, it stores them in the action's local object repository. You can choose to keep the stored objects in the local object repository, or you can choose to store the objects in a shared object repository. Storing the objects in the local object repository makes them available only to the specific action, but not to other actions. Storing the objects in one or more shared object repositories enables multiple tests to use them. You can also work with a combination of local and shared object repositories, as needed. For more information on local and shared object repositories



15.   What are Optional Steps in QTP?

An optional step is a step that is not necessarily required to successfully complete a run session. For example, suppose that when recording a test, the application you are testing prompts you to enter a user name and password in a login window. When you run the test, however, the application does not prompt you to enter your user name and password because it retained the information that was previously entered. In this case, the steps that were recorded for entering the login information are not required and should, therefore, be marked optional.

During a run session, if the object of an optional step does not exist, QTP bypasses this step and continues to run the test. When the run session ends, a message is displayed for the step indicating that the step was not performed, but the step does not cause the run to fail.

However, if, during a run session, QTP cannot find the object from the optional step in the object repository (for example, if the object name was modified in the test but not in the object repository, or if the object was removed from the object repository), an error message is displayed listing the required object, and the run fails.

During a recording, QTP automatically marks steps that open certain dialog boxes as optional. You can also manually designate steps as optional.

16.   How can I access HTML tags directly in QTP?

QuickTest provides direct access to the browser's Document Object Model (DOM) through which you can access the HTML tags directly. Access to the DOM is performed using the .Object notation.

The test below demonstrates how to iterate over all the tags in a page. The test then outputs the inner-text of the tags (the text contained between the tags) to the Test Results using the Reporter object.

' Use the on error because not all the elements have inner-text.

On Error Resume Next

Set Doc = Browser("CNN Interactive").Page("CNN Interactive").Object

' Loop through all the objects in the page.

For Each Element In Doc.all

TagName = Element.TagName ' Get the tag name.

InnerText = Element.innerText ' Get the inner text.

' Write the information to the test results.

Reporter.ReportEvent 0, TagName, InnerText

Next



17.   What are Permissions Required to Run QTP?

You must make sure the following access permissions are set in order to run QuickTest Professional.
Permissions Required to Run QuickTest Professional

You must have the following file system permissions:

* Full read and write permissions for all the files and folders under the folder in which QuickTest is installed
* Full read and write permissions to the Temp folder
* Read permissions to the Windows folder and to the System folder

You must have the following registry key permissions:

* Full read and write permissions to all the keys under HKEY_CURRENT_USER\Software\Mercury Interactive
* Read and Query Value permissions to all the HKEY_LOCAL_MACHINE and HKEY_CLASSES_ROOT keys

Permissions Required When Working with Quality Center

You must have the following permissions to use QuickTest with Quality Center:

* Full read and write permissions to the Quality Center cache folder
* Full read and write permissions to the QuickTest Add-in for Quality Center installation folder




18.   What are the advantages of Keyword Driven testing in QTP?

Keyword-driven testing is a technique that separates much of the programming work from the actual test steps so that the test steps can be developed earlier and can often be maintained with only minor updates, even when the application or testing needs change significantly.

Advantages:

1. Although this methodology requires more planning and a longer initial time-investment than going directly to the test creation stage and recording your steps, this methodology makes the test creation and test maintenance stages more efficient and keeps the structure of individual tests more readable and easier to modify.
2. By creating your tests with a keyword-driven methodology in mind, your tests become more modular, focusing on the operations to test using both QuickTest built-in keywords and your own user-defined keywords.
3. It is possible to add objects to the object repository before they exist in an application; it is possible to begin preparing your automated keyword-driven tests even before a build containing the new objects is available.
4. By encapsulating much of the complex programming into function libraries, and by making these functions flexible enough to use in many testing scenarios (through the use of function parameters that control the way the functions behave), one or a few automation experts can prepare the keywords that many application testers who are less technical can include in multiple tests. This also makes it possible to update testing functionality without having to update all the tests that use the keywords.
5. Developing and documenting business-level keywords in function libraries. Creating function libraries involves developing customized functions for the application you want to test. You may want to develop functions to test special application functionality that is not already supplied by the methods in the QuickTest object model. It is also useful to wrap existing methods and functions together with additional programming to create application-specific functions for testing operations or sequences that are commonly performed in your application. The functions you create will be available either as extra keywords or as replacements for built-in QuickTest keywords during the test creation stage.



19.   What are the contents of the Programming Statements used in QTP tests?

The easiest way to create a test is to begin by recording typical business processes that you perform on your application or Web site. Then, to increase the power and flexibility of your test, you can add steps that contain programming logic to the recorded framework. Programming statements can contain:

* recordable test object methods. These are operations that a user can perform on an application or Web site.
* non-recordable test object methods. These are operations that users cannot perform on an application or Web site. You use these methods to retrieve or set information, or to perform operations triggered by an event.
* run-time methods of the object being tested.
* various VBScript programming commands that affect the way the test runs, such as conditions and loops. These are often used to control the logical flow of a test.
* supplemental statements, such as comments, to make your test easier to read, and messages that appear in the test results, to alert you to a specified condition.



20.   What are the Differences between Business Components and Tests in QTP?

In Business process testing the combination of components will become a test (business process test) Components are easily-maintained, reusable units that perform a specific task. They are the building blocks of business process tests. Each component is comprised of several application steps that are logically performed together in a specific order. For example, in a Web application, a login component might be comprised of four steps. Its first step could be to open the application. Its second step could be to enter a user name. Its third step could be to enter a password, and its last step could be to click the Submit button on the Web page. By creating and calling functions stored in
function libraries, you can enhance the component with additional logic to
test important details of the login task. By design, each component tests a specific part of an application. When combined, components are incorporated into a business process test in a serial flow representing the main tasks performed within a particular business process. The task of creating and running components and business process tests is generally performed by Subject Matter Experts working in Quality Center.

If you are already familiar with using QuickTest to create action-based tests, you will find that the procedures for creating and editing components are quite similar. However, due to the design and purpose of the component model, there are certain differences in the way you create, edit, and run components. The guidelines below provide an overview of these differences.

* 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 you are currently connected.
* The name of the component node in the Keyword View is the same as the saved component. You cannot rename the node.
* Business components are created in the Keyword View, not the Expert View.
* You 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 you are testing.


21.   What are the Elements of Recovery Scenario in QTP?

The Recovery Scenario Wizard leads you, step-by-step, through the process of creating a recovery scenario. The Recovery Scenario Wizard contains the following main steps Elements of Recovery Scenario in QTP:

* Defining the trigger event that interrupts the run session - 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.

* Specifying the recovery operations required to continue - 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.

* Choosing a post-recovery test run operation - 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.
* specifying a name and description for the recovery scenario
* (for tests) specifying whether to associate the recovery scenario to the current test and/or to all new tests



22.   What are the Environment Variables in QTP?

1) User-Defined Internal Variables: These are the variables that we define within the test. These variables are saved with the test and are accessible only within the test in which they were defined.

2) User-Defined External Variables: These are the variables that we predefine in the active external environment variables file. We can create as many files as we want and select an appropriate file for each test, or change files for each test run.

3) Built-in Variables: These are the variables that represent information about the test and the computer on which the test is run, such as Test path and Operating system. These variables are accessible from all tests, and are designated as read-only.



23.   Where can I find information on the IE Document Object Model (NOT FOR INTERVIEW – IT IS FOR INFORMATION PURPOSE ONLY)?

For information on the IE DOM, browse to the following Web sites:

Document object: http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_document.asp

Other DHTML objects: http://msdn.microsoft.com/workshop/author/dhtml/reference/objects.asp

General DHTML reference: http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp



24.   What are the key features of QTP at a glance?

Read ->
http://www.onestopsoftwaretesting.com/2008/11/what-are-key-features-of-qtp-at-glance.html


90. What are the main stages of Testing with QTP?

Testing with QuickTest involves the following main stages:

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



25.   What are the methods to populate the XML Tree in QTP?

When you create an XML checkpoint for a test object operation (for a WebService test object), the expected operation return value data cannot be generated. Therefore, only a generic XML tree is created. To check the operation return values, you must first populate the XML tree with the actual elements, attributes, and values that the operation is expected to return.

You can use one of the three methods below to populate the XML tree:
* Updating the XML Tree Manually
* Importing an XML Tree from a File
* Updating the XML Tree Using Update Run Mode


26.   What are the modes available to open a function library in QTP?

You can open function libraries from the file system and function libraries that are part of a Quality Center project. You can open as many function libraries as you want. The QuickTest Script Editor works with .qfl, .vbs, and .txt function library files.

After you open a function library, it is displayed in a function library window in the display area, and the function library and its functions are displayed in the Opened Function Libraries folder at the top of the tree in the Resources pane. If the function library is associated with an open test, it is also displayed under the test as a function library link in the Associated Function Libraries folder in the tree in the Resources pane.

Tip: You can open an existing function library by dragging it from the file system (Windows Explorer) to the Script Editor window. You can open a recently used function library by selecting it from the Recent Files list in the File menu.

To open a function library:

1. Click the Quality Center Connection button and connect to Quality Center, if required. For more information on connecting to Quality Center, refer to the QuickTest Professional documentation.
2. Open the function library in one of the following ways:
* In the Resources pane, double-click the function library to open, or right-click the function library, and choose Show.
* Click the Open Function Library toolbar button, choose File > Open > Function Library, or press Ctrl+Shift+O. The Open Function Library dialog box opens. Select a function library, and click Open.

Note: The Open button toggles between Open Test and Open Function Library, according to the active window in the display area. To change the Open Test button to Open Function Library, click the arrow next to the button and then select Function Library, or click a function library window in the display area.

The window opens, and the function library is displayed in the Opened Function Libraries folder at the top of the tree in the Resources pane.

If you open a function library from the file system that is opened by another user, you are notified if changes are made by the other user, and given the option to accept or reject the changes made.

If you open a function library saved in Quality Center that is opened by another Quality Center user, you will be notified that the function library has been locked, and by whom, and that the function library will be opened in read-only mode. In addition, if you open a function library saved in Quality Center, it will be locked and no other user can modify it until you close it.



27.   What are the options available for configuring Data Table Parameters in QTP?
Defining the Settings for a Data Table Parameter

The following options are available for configuring Data Table parameters:

Name. Specifies the name of the parameter in the Data Table. You can create a new parameter by using the default parameter name or entering a new, descriptive name. Alternatively, you can select an existing Data Table parameter from the list.

Note: The parameter name must be unique in the sheet. It can contain letters, numbers, periods, and underscores. The first character of the parameter name must be a letter or an underscore. If you specify an invalid name, QuickTest displays a warning message when you click OK. You can choose to edit the name manually or to instruct QuickTest to fix the name automatically (by adding an underscore at the beginning of the name).

Location in Data Table. Specifies whether to store the parameter in the global or current action sheet in the Data Table.



28.   How can I send keyboard key commands (such as shortcut commands) to Web objects in QTP ?

For Web objects (or other objects that do not support the Type method), use the Windows Scripting SendKeys method.



29.   What are the options available for configuring Environment Variable Parameters in QTP?

The following options are available for configuring environment variable parameters:

* Name. Specifies the name of the parameter. For an internal user-defined environment variable parameter, you can create a new parameter by using the default parameter name or entering a new, descriptive name. Alternatively, you can select an existing internal user-defined environment variable parameter from the list.

Notes:

If you edit the name displayed in the Name box for an existing parameter, you create a new internal user-defined environment variable parameter. The original environment variable parameter is not modified.

If you are parameterizing an argument that receives a predefined constant or number, only the environment variable parameters whose value is of type integer are shown in the Name list.

* Value. Specifies the value of the parameter. You can enter the value for a new user-defined internal parameter, or modify the value for an existing user-defined internal parameter. External and built-in environment variable parameter values cannot be modified in this dialog box.

If the entire value of a selected environment variable parameter cannot be displayed in the Value box, it is shown as [complex value]. For example, the value of a list's all items property is a multi-line value, where each line contains the value of an item in the list.

You can view or edit a complex value by clicking the View/Edit Complex Value button.

· Type. Specifies the type of environment variable parameter (read-only):

o internal user-defined
o external user-defined
o built-in

Tip: The value of an environment variable remains the same throughout the test run, regardless of the number of iterations, unless you change the value of the variable programmatically in your script.

* Regular expression. Sets the value of the parameter as a regular expression. This option is available only when parameterizing a checkpoint or object property text string value, and the selected environment variable parameter type is internal user-defined.



30.   What are the options available when outputting a value to the Data Table in QTP?

Name. Specifies the name of the parameter in the Data Table. You can create a new parameter by using the default parameter name or entering a new, descriptive name. Alternatively, you can select an existing Data Table parameter from the list.

Note: The parameter name must be unique in the sheet. It can contain letters, numbers, periods, and underscores. The first character of the parameter name must be a letter or an underscore. If you specify an invalid name, QuickTest displays a warning message when you click OK. You can choose to edit the name manually or to instruct QuickTest to fix the name automatically (by adding an underscore at the beginning of the name).

Location in Data Table. Specifies whether to store the parameter in the global or current action sheet in the Data Table.

Advanced configuration (if applicable):

* Regular expression. Sets the value of the parameter as a regular expression. Note that this option is available only when parameterizing checkpoint and object property values.
* Use Data Table formula. (If applicable.) Inserts two columns in the Data Table. The first column contains a formula that checks the validity of output in the second column. QuickTest uses the data in the output column to compute the formula, and inserts a value of TRUE or FALSE in the table cell of the formula column. Note that this option is available only for checkpoints. For more information on using Data Table formulas,



31.   What are the possibilities of exporting the data among various Object Repositories in QTP?
Exporting Local Objects to an Object Repository in QTP

You can export all of the objects contained in an action's local object repository to a new shared object repository in the file system or to a Quality Center project (if QuickTest is connected to Quality Center). This enables you to make the local objects accessible to other actions. You export local objects to a new shared object repository using the Object Repository window.

When you export local objects to a shared object repository, the parameters of any parameterized objects are converted to repository parameters using the same name as the source parameter. The default (mapped) value of each repository parameter is the corresponding source parameter. You can modify the mapping used within your action using the Map Repository Parameters dialog box.

Tip: After you export the local objects, you can use the Object Repository Merge Tool to merge the shared object repository containing the exported objects with another shared object repository.

To export local objects to a new shared object repository:

1. Open the test that has the local objects you want to export.
2. Make sure that the Object Repository window is open.
3. In the Object Repository window, in the Action box, choose the action whose local objects you want to export.
4. Choose File > Export Local Objects. The Export Object Repository dialog box opens.

Note: If you are connected to Quality Center, the dialog box that opens is different from the standard file system dialog box. You can switch between the two dialog box versions by clicking the File System and Quality Center buttons in the Export Object Repository dialog box.

5. Select the location in which to save the file, specify the file or attachment name, and click Save or OK (depending on whether you are saving it to the file system or a Quality Center project).

The object repository is exported to the specified shared object repository (a file with a .tsr extension). You can now use the new shared object repository like any other shared object repository.


98. What are the Properties used by Smart Identification Feature of QTP?

The Smart Identification mechanism uses two types of properties:

Base Filter Properties. The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from to any other value; you could no longer call it the same object.
Optional Filter Properties. Other properties that can help identify objects of a particular class. These properties are unlikely to change on a regular basis, but can be ignored if they are no longer applicable.





32.   What are the situations best suited for using an existing Checkpoint in QTP?

If the application contains multiple edit boxes, we can reuse a checkpoint to confirm the enabled status of these edit boxes throughout our test.

If the each webpage contains same logo and same text, then we can use existing Checkpoint.



33.   How can I record on nonstandard menus in QTP?

You can modify how QuickTest behaves when it records menus. The options that control this behavior are located in the Advanced Windows Applications Options dialog box. (Tools > Options > Windows Applications > Advanced).

34.   Deciding Whether to Use Local or Shared Object Repositories in QTP
To choose where to save objects, you need to understand the differences between local and shared object repositories.
In general, the local object repository is easiest to use when you are creating simple record and run tests, especially under the following conditions:
You have only one, or very few, tests that correspond to a given application interface, or set of objects.
You do not expect to frequently modify test object properties.
You generally create single-action tests.
Conversely, the shared object repository is generally the preferred option when:
You are creating tests using keyword-driven methodologies (not using record).
You have several tests that test elements of the same application, interface, or set of objects.
You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties.
You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.

35.   How QTP Identifies the Object?
QuickTest has a predefined set of properties that it learns for each test object. If these mandatory property values are not sufficient to uniquely identify an object you record or add, QuickTest can add some assistive properties and/or an ordinal identifier to create a unique description.

Mandatory properties are properties that QuickTest always learns for a particular test object class.

Assistive properties are properties that QuickTest learns only if the mandatory properties that QuickTest learns for a particular object in your application are not sufficient to create a unique description. If several assistive properties are defined for an object class, then QuickTest learns one assistive property at a time, and stops as soon as it creates a unique description for the object. If QuickTest does learn assistive properties, those properties are added to the test object description.

Note: If the combination of all defined mandatory and assistive properties is not sufficient to create a unique test object description, QuickTest also learns the value for the selected ordinal identifier. For more information, see
Selecting an Ordinal Identifier.

When you run a test, QuickTest searches for the object that matches the description it learned (without the ordinal identifier). If it cannot find any object that matches the description, or if it finds more than one object that matches, QuickTest uses the Smart Identification mechanism (if enabled) to identify the object. In many cases, a Smart Identification definition can help QuickTest identify an object, if it is present, even when the learned description fails due to changes in one or more property values. The test object description is used together with the ordinal identifier only in cases where the Smart Identification mechanism does not succeed in narrowing down the object candidates to a single object.

You use the Object Identification dialog box (Tools > Object Identification) to configure the mandatory, assistive, and ordinal identifier properties that QuickTest uses to learn descriptions of the objects in your application, and to enable and configure the Smart Identification mechanism.

The Object Identification dialog box also enables you to configure new user-defined classes and map them to an existing test object class so that QuickTest can recognize objects from your user-defined classes when you run your test.



QuickTestPro Interview Questions and Answers part 4



1.     How can we check the location of a cell to be checked in a Column of a table?

The settings in the Cell Identification tab determine how QTP locates the cells to be checked. The settings in this tab apply to all selected cells.
The Cell Identification tab includes the following options:

i. Identify columns : Specifies the location of the column (in your actual table) containing the cell(s) to which you want to compare the expected data.

· By position. (Default) Locates cells according to the column position. A shift in the position of the columns within the table results in a mismatch.

· By column name. Locates cells according to the column name. A shift in the position of the columns within the table does not result in a mismatch. (Enabled only when the table contains more than one column.)

ii. Identify rows : Specifies the location of the row (in your actual table) containing the cell(s) to which you want to compare the expected data.

· By row number. (Default) Locates cells according to the row position. A shift in the position of any of the rows within the table results in a mismatch.

· By selected key column(s). Locates the row(s) 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(s) does not result in a mismatch. If more than one row is identified, QTP checks the first matching row. You can use more than one key column to uniquely identify any row.

Note: A key symbol is displayed in the header of selected key columns.

iii. Use value match criteria to identify data in the key column: Instructs QTP to use the verification type settings from the Settings tab as the criteria for identifying data in the key column.

Enabled only when you select to identify rows By selected key column(s).

http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx

2.     How do I make the QTP test prompt the user for input while it is running ?

The VBScript InputBox function enables you to display a dialog box that prompts the user for input and then continues running the test. You can use the value that was entered by the user later in the run session. For more information on the InputBox function, refer to the VBScript Reference.

The following example shows the InputBox function used to prompt the user for a password.

Browser("Mercury Tours").Page("Mercury Tours").WebEdit("username").Set "administrator"
Passwd = InputBox ("Enter password", "User Input")
Browser("Mercury Tours").Page("Mercury Tours").WebEdit("password").Set Passwd


3.     How can we check the location of a cell to be checked in a Row of a table?

The settings in the Cell Identification tab determine how QTP locates the cells to be checked. The settings in this tab apply to all selected cells.

Identify rows : Specifies the location of the row (in your actual table) containing the cell(s) to which you want to compare the expected data.

· By row number. (Default) Locates cells according to the row position. A shift in the position of any of the rows within the table results in a mismatch.

· By selected key column(s). Locates the row(s) 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(s) does not result in a mismatch. If more than one row is identified, QTP checks the first matching row. You can use more than one key column to uniquely identify any row.


4.     How can we check the object property values in our application?

You can check the object property values in your Web site or application using standard checkpoints. Standard checkpoints compare the expected values of object properties captured during recording to the object's current values during a run session.

You use standard checkpoints to perform checks on images, tables, Web page properties, and other objects within your application or Web site.

Note: You can create standard checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded).


5.     How can we compare objects among two object repositories in QTP?

Using the Object Repository Comparison Tool, you can compare two object repositories according to predefined settings that define how differences between objects are identified.

To compare two object repositories:

1. In QTP Professional, choose Resources > Object Repository Manager.

2. In the Object Repository Manager, choose Tools > Object Repository Comparison Tool. The New Comparison dialog box opens on top of the Object Repository - Comparison Tool window.
(click on the below image to see clear view)
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi-gdqecu5OyQJ0zuBfy3ETlz3W8Ms9bFvTsBF-w3-pZ6YbQcxkLg8Kd-zdcidX2Z1LcW_uKleJ7ctHw7kac-na5dv4IRIoPEgRShDUXo-MvHpLFKq05Ju1qoX1aUjOxsSAbGwY3O9gfY/s200/image006.jpg

6.     How can we compare the image files in the Image Checkpoint in QTP?

Image checkpoints enable you to check the properties of a Web image. In the Image Checkpoint Properties dialog box, you can specify which properties of the image to check and edit the values of those properties. This dialog box is similar to the standard Checkpoint Properties dialog box, except that it contains the Compare image content option. This option enables you to compare the expected image source file with the actual image source file.


7.     How can we create a QTP Test in Quality Center?

To create a business process test, the Subject Matter Expert selects (drags and drops) the components that apply to the business process test and configures their run settings.

Note: When you run a business process test from Quality Center, the test run may also be influenced by settings in the QTP Remote Agent.

Each component can be used differently by different business process tests. For example, in each test the component can be configured to use different input parameter values or run a different number of iterations.

If, while creating a business process test, the Subject Matter Expert realizes that a component has not been defined for an element that is necessary for the business process test, the Subject Matter Expert can submit a component request from the Test Plan module.
http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx


8.     How can I record and run tests on objects that change dynamically from viewing to viewing?

Sometimes the content of objects in a Web page or application changes due to dynamic content. You can create dynamic descriptions of these objects so that QTP will recognize them when it runs the test.


9.     How can we debug a Function Library?

Before you can debug a function library, you must first associate it with a component (via its application area) and then insert a call to at least one of its functions. For example, you can use the Debug Viewer to view, set, or modify the current value of objects or variables in your function library. You can step into functions (including user-defined functions), set breakpoints, stop at breakpoints, view expressions, and so forth. You can begin debugging from a specific step, or you can instruct QTP to pause at a specific step.

Note: During a debug session, all documents are read-only and cannot be edited. To edit a document during a debug session, you must first stop the debug session.

After you create a component or function library (including registered user functions), you should check that they run smoothly, without errors in syntax or logic. To debug a function library, you must first associate it with a component via its application area and then debug it from that component.

To detect and isolate defects in a component or function library, you can control the run session using the Pause command as well as various step commands that enable you to step into, over, and out of a specific step.

You can use the Debug from Step command to begin your debug session at a specific point in your component. You can also use the Run to Step command to pause the run at a specific point in your component. You can set breakpoints, and then enable and disable them as you debug different parts of your component or function library.

When the component or function library run stops at a breakpoint, you can use the Debug Viewer to check and modify the values of VBScript objects and variables. Also, if QTP displays a run error message during a run session, you can click the Debug button on the error message to suspend the run and debug the component or function library.

You can also use the Run from Step command to run your component or function library from a selected step to the end. This enables you to check a specific section of your application or to confirm that a certain part of your component or function library runs smoothly.

Notes:

- While the component and function libraries are running in debug mode, they are read-only. You can modify the content after you stop the debug session (not when you pause it). If needed, you can enable the function library for editing (File > Enable Editing) after you stop the session.

After you implement your changes, you can continue debugging your component and function libraries.

- If you perform a file operation (for example, open a different component or create a new component), the debug session is stopped.

- In QTP, when you open a component, QTP creates a local copy of the external resources that are saved to your Quality Center project. Therefore, any changes you apply to any external resource that is saved in your Quality Center project, such as a function library, will not be implemented in the component until the component is closed and reopened. (An external resource is any resource that was not created using QTP, such as, a function library created in an external editor.)

10.   How can we define a time interval for QTP to perform a checkpoint successfully?

You can specify the time interval during which QTP attempts to perform the checkpoint successfully by modifying the selections in the bottom part of the Text/Text Area Checkpoint Properties dialog box. You can also specify when to perform the checkpoint.
• Checkpoint timeout. Specifies the time interval (in seconds) during which QTP attempts to perform the checkpoint successfully. 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.
If you specify a checkpoint timeout other than 0, and the checkpoint fails, the Test Results window displays information on the checkpoint timeout.
• Insert statement. Specifies when to perform the checkpoint. Choose Before current step if you want to check the value of the text before the highlighted step is performed. Choose After current step if you want to check the value of the text after the highlighted step is performed.
Note: The Insert statement option is not available when adding a new text checkpoint or a text area checkpoint during recording, or when modifying an existing checkpoint. It is available only when adding a new text checkpoint to an existing test while editing.
http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx


11.   How can we Disable Smart Identification During the Run Session in QTP?

Selecting the Enable Smart Identification check box for a particular test object class instructs QTP to learn the property values of all properties specified as the object's base and/or optional filter properties in the Smart Identification Properties dialog box.

By default, some test objects already have Smart Identification configurations and others do not. Those with default configurations also have the Enable Smart Identification check box selected by default.

http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx

12.   You should enable the Smart Identification mechanism only for test object classes that have defined Smart Identification configuration. However, even if you define a Smart Identification configuration for a test object class, you may not always want to learn the Smart Identification property values. If you do not want to learn the Smart Identification properties, (To Disable Smart Identification in QTP) clear the Enable Smart Identification check box.

Note: Even if you choose to learn Smart Identification properties for an object, you can disable use of the Smart Identification mechanism for a specific object in the Object Properties or Object Repository dialog box.
However, if you do not learn Smart Identification properties, you cannot enable the Smart Identification mechanism for an object later.


13.   How can we do part running of the QTP Test script?
The Run from Step option in the Test menu is used to run the test from a selected step to the end of the current action, if running from the Expert View, or to the end of the test , if running from the Keyword View. Thus it enables us to check a specific part of the application or to confirm that a certain part of the test runs correctly.
http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx


14.   How can I check by QTP that a child window exists (or does not exist)?
Sometimes a link in one window creates another window.
You can use the Exist property to check whether or not a window exists. For example:
Browser("Window_name").Exist
You can also use the ChildObjects method to retrieve all child objects (or the subset of child objects that match a certain description) on the Desktop or within any other parent object.

How can we do the nesting of If...Then...Else statement in QTP?
If condition Then
[statements]
[ElseIf condition-n Then
[elseifstatements] . . .
[Else
[elsestatements]
End If


15.   How can we ensure that a text string appears in a specified area in QTP?
In the Text/Text Area Checkpoint Properties dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during run sessions.

For example, suppose you want to check the third occurrence of a particular text string in a page. To check for this string, you can specify which text precedes and/or follows it and to which occurrence of the specified text string you are referring.


16.   How can we identify a checkpoint in QTP?
QTP enables you to add checks to your test. A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. This enables you to identify whether your Web site or application is functioning correctly.

When you add a checkpoint, QTP adds a checkpoint to the current row in the Keyword View and adds a Check CheckPoint statement in the Expert View. By default, the checkpoint name receives the name of the test object on which the checkpoint is being performed. You can choose to specify a different name for the checkpoint or accept the default name.

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

Tip: You can also use the CheckProperty method and the CheckItemProperty method to check specific property or item property values.

Note: If you want to retrieve the return value of a checkpoint (a boolean value that indicates whether the checkpoint passed or failed), you must add parentheses around the checkpoint argument in the statement in the Expert View. For example:

a = Browser("MyBrowser").Page("MyPage").Check (CheckPoint("MyProperty"))
http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx


17.   How can we incorporate decision-making into the QTP tests?
Using conditional statements, you can incorporate decision making into your tests. Using loop statements, you can run a group of steps repeatedly, either while or until a condition is true. You can also use loop statements to repeat a group of steps a specific number of times.
After you insert a conditional or loop statement in the Keyword View, you can insert or record steps after the statement to include them in the conditional or loop block.


18.   How can we increase the Readability of our QTP Tests scripts?
To increase readability, use With Statement.
You can instruct QTP to automatically generate With statements for the steps you record. When you select this option, statements are displayed in their normal format while recording. When you stop recording, the statements in all actions recorded during the current recording session are automatically converted to the With format.


19.   To generate With statements automatically when you record:
1. Choose Tools > Options or click the Options toolbar button. The Options dialog box opens.
2. In the General tab, select Automatically generate "With" statements after recording.
3. Enter the minimum number of consecutive, identical objects for which you want to apply the With statement in the Generate "With" statements for __ or more objects box.
The default is 2.

Note: This setting is used when you use the Apply "With" to Script option as well as for the Automatically generate "With" statements after recording option.

For example, if you only want to generate a With statement when you have three or more consecutive statements based on the same object, enter 3.

4. Begin recording your test. While recording, statements are recorded normally. When you stop recording, the statements in all actions recorded during the current recording session are automatically converted to the With format.
The With statement has the following syntax.
With object
.....statement
.....statement
.....statement
End With

For example, you could replace this script:
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "19097 LON "
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click

with the following:

With Window("Flight Reservation")
.WinComboBox("Fly From:").Select "London"
.WinComboBox("Fly To:").Select "Los Angeles"
.WinButton("FLIGHT").Click
With .Dialog("Flights Table")
.WinList("From").Select "19097 LON "
.WinButton("OK").Click
End With 'Dialog("Flights Table")
End With 'Window("Flight Reservation")

Note: Using With statements in your test has no effect on the run session itself, only on the way your test appears in the Expert View. Generating With statements for your test does not affect the Keyword View in any way.

http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx

20.   How does QTP record on dynamically generated URLs and Web pages?
QTP actually clicks links as they are displayed on the page. Therefore, QTP records how to find a particular object, such as a link on the page, rather than the object itself. For example, if the link to a dynamically generated URL is an image, then QTP records the "IMG" HTML tag, and the name of the image. This enables QTP to find this image in the future and click on it.



21.   How can we insert a checkpoint or output value statement in Expert View of QTP Manually?
We cannot insert standard checkpoints and other predefined checkpoints or output value statement in Expert View of QTP Manually.
But we can insert descriptive checkpoints (Like If… Else) in the expert view of QTP while editing/updating the test scripts.


22.   How can we Integrate QTP with Quality Center?
At its most basic level, integrating QTP with Quality Center enables you to store and access QTP tests and function libraries in a Quality Center project, when QTP is connected to Quality Center.

In addition, your tests and function libraries can use the QCUtil object to access and use the full functionality of the Quality Center OTA (Open Test Architecture)—formerly known as TestDirector OTA or TDOTA. This enables you to automate integration operations during a run session, such as reporting a defect directly to a Quality Center database.
You can also use the TDOTA object in your QTP automation scripts to access the Quality Center OTA.


23.   How can we locate Test Objects in an Object Repository in QTP?
You can select an object in the application or Web site you are testing and highlight the test object in the object repository.

For example, to locate a Find a Flight image in a Web page, you can select it in your Web page using the pointing hand mechanism. After you select the Find a Flight image object from the selection dialog box and click OK, the parent hierarchy in the object repository tree expands and the Find a Flight image test object is highlighted.

To locate an object in the object repository:
1. Make sure your application or Web site is open to the correct window or page.
2. Click the Locate in Repository button or choose View > Locate in Repository. QTP is hidden, and the pointer changes into a pointing hand.
3. Use the pointing hand to click on the required object in your application or Web site.

Tip: You can hold the left CTRL key to change the window focus or perform operations such as right-clicking or moving the pointer over an object to display a context menu. If the window containing the object you want to click is partially hidden by another window, you can also hold the pointing hand over the partially hidden window for a few seconds until the window comes into the foreground and you can point and click on the object you want. Additionally, if the window containing the object you want to select is minimized, you can display it by holding the left CTRL key, right-clicking the application in the Windows task bar, and choosing Restore from the context menu.
If the location you clicked is associated with more than one object, the Select an Object dialog box opens.
4. Select the object you want to locate in the object repository and click OK. The selected object is highlighted in the object repository.
5.Tip: If the relevant object repository is not open or the object cannot be found, the object is not highlighted. In the Object Repository Manager, if more than one shared object repository is open, and QTP cannot locate the selected object in the active object repository, you can choose whether to look for the object in all of the currently open object repositories.


24.   How does QTP handle cookies?
Server side connections, such as CGI scripts, can use cookies both to store and retrieve information on the client side of the connection.
QTP stores cookies in the memory for each user, and the browser handles them as it normally would.


How can we parameterize a step in QTP?
Parameterize the method argument of the fromPort step:

In the Keyword View, click in the Value cell of the step and then click the parameterization icon. In the Value Configuration Options dialog box, select the Parameter radio button. In the Name box, rename p_item to Location.

Click OK. The Location column is added to the Data Table.
http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx


25.   How can we perform Import & Export Operations among various Object Repositories in QTP?
You can export all of the objects contained in an action's local object repository to a new shared object repository in the file system or to a Quality Center project (if QTP is connected to Quality Center). This enables you to make the local objects accessible to other actions. You export local objects to a new shared object repository using the Object Repository window.


26.   To export local objects to a new shared object repository:
1. Open the test that has the local objects you want to export.
2. Make sure that the Object Repository window is open.
3. In the Object Repository window, in the Action box, choose the action whose local objects you want to export.
4. Choose File > Export Local Objects. The Export Object Repository dialog box opens.

Note: If you are connected to Quality Center, the dialog box that opens is different from the standard file system dialog box. You can switch between the two dialog box versions by clicking the File System and Quality Center buttons in the Export Object Repository dialog box.
5. Select the location in which to save the file, specify the file or attachment name, and click Save or OK (depending on whether you are saving it to the file system or a Quality Center project).
The object repository is exported to the specified shared object repository (a file with a .tsr extension). You can now use the new shared object repository like any other shared object repository.

Tip: After you export the local objects, you can use the Object Repository Merge Tool to merge the shared object repository containing the exported objects with another shared object repository.

How can we perform Merge Operations among various Object Repositories in QTP?
QTP Professional provides the ability to merge existing assets from two object repositories into a single shared object repository using the Object Repository Merge Tool. This tool enables you to merge two shared object repositories (called the primary object repository and the secondary object repository), into a new third object repository, called the target object repository. Objects in the primary and secondary object repositories are automatically compared and then added to the target object repository according to preconfigurable rules that define how conflicts between objects are resolved.

After the merge process, the Object Repository Merge Tool provides a graphic presentation of the original objects in the primary and secondary object repositories, which remain unchanged, as well as the objects in the merged target object repository. Objects that had conflicts are highlighted. The conflict of each object that you select in the target object repository is described in detail. The Object Repository Merge Tool provides specific options that enable you to keep the suggested resolution for each conflict, or modify each conflict resolution individually, according to your requirements.

The Object Repository Merge Tool also enables you to merge objects from the local object repository of one or more actions into a shared object repository. For example, if QTP learned objects locally in a specific action in your test, you may want to add the objects to the shared object repository, so that they are available to all actions in different tests that use that object repository.
You open the Object Repository Merge Tool by choosing Tools > Object Repository Merge Tool in the Object Repository Manager.
http://futurethoughtsllc.com/QTPInterviewQuestionsAnswers.aspx


27.   How can we retrieve all objects located inside a Parent Object with QTP?
You can use the ChildObjects method to retrieve all objects located inside a specified parent object, or only those child objects that fit a certain programmatic description. To retrieve this subset of child objects, you first create a description object and add the set of properties and values that you want your child object collection to match using the Description object.
Note: You must use the Description object to create the programmatic description for the ChildObjects description argument. You cannot enter the programmatic description directly into the argument using the property:=value syntax.

Once you have "built" a description in your description object, use the following syntax to retrieve child objects that match the description:

Set MySubSet=TestObject.ChildObjects(MyDescription)
For example, the statements below instruct QTP to select all of the check boxes on the Itinerary Web page:
Set MyDescription = Description.Create()
MyDescription("html tag").Value = "INPUT"
MyDescription("type").Value = "checkbox"
Set Checkboxes = Browser("Itinerary").Page("Itinerary").ChildObjects(MyDescription)
NoOfChildObjs = Checkboxes.Count
For Counter=0 to NoOfChildObjs-1
Checkboxes(Counter).Set "ON"
Next

In the Test Results, square brackets around a test object name indicate that the test object was created dynamically during the run session using the ChildObjects method or a programmatic description.


28.   Where can I find a Web page's cookie with QTP?
The cookie used by the browser can be accessed through the browser's Document Object Model (DOM). In the following example the cookie collection is returned the from the browser.
Browser("Flight reservations").Page("Flight reservations").Object.Cookie

29.   How QTP recognizes objects in Object Repositories?

In QTP, the Object Repository window displays a tree of all objects in the current component or in the selected action (including all local objects and all objects in any shared object repositories associated with the selected action or component).

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 learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description. If no assistive properties are available, then it adds a special Ordinal identifier such as objects location on the page or in the source code.




Does QTP work with .asp?

Dynamically created Web pages utilizing Active Server Page technology have an .asp extension. This technology is completely server-side and has no bearing on QTP.