This is my personal blog for my software testing study purposes. The topics posted in this blog are mine and from some other sources (credits are given). I always add those topics which helps me. Hope these topics will help you guys also.
- Happy testing

Recent Posts

QTP & Keyword Driven Testing

Tricky Questions in QTP

Asset Upgrade tool in QTP

New Features in QTP 10

Dec 22, 2008

Answers to QTP Interview Questions - Part - 6 (New)

Subscribe the QA and Software Testing Newsletter
Post Your Queries | QA and Testing - Table of Contents

SPONSORED LINKS Reading: Answers to QTP Interview Questions - Part - 6 (New)Tweet this Post

(Reference for the below answers: Mercury QTP User Guide)

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


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


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

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


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

66. How to decide on whether to save the objects in Local or Shared Object Repositories?

Click here for the answer:

http://www.onestopsoftwaretesting.com/2008/12/use-local-or-shared-object-repositories.html


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

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.


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


69. In what situations recording mechanism shall be useful in creating tests in QTP?

Click on the below link to read answer:

http://www.onestopsoftwaretesting.com/2008/11/in-what-situations-recording-mechanism.html


70. In what situations we output a value for a step in a test action?


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


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

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

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

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


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


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

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


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


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

SPONSORED LINKS

Comments :

0 comments to “Answers to QTP Interview Questions - Part - 6 (New)”

Software testing Metrices-Test Case Review

Metrics are the means by which the software quality can be measured; they give you confidence in the product.

 

Energize your test team

You're waist deep in your third month of late nights, weekends, and shipping stress; you can see and feel your team's energy waning.

 

The Value of Positive Testing

There is a school of thought in software testing that debunks the value of positive testing. This school basically states that any test that does not produce a defect is not a good test.

Impact Analysis Checklist for Req. Changes
___    Implications of the Proposed Change* Identify any existing requirements in the baseline that

The Process of Test Process Improvement

Software testing is still a pain-in-the-neck for many organizations. Because it is only marginally addressed in software process improvement models like CMMi

 

Software Defect-bug Management Philosphy

Imperfect processes cause most of the software defects. Thus to prevent defects, the development process needs to be overhauled.

 

Software testing Metrices-Test Case Review

Metrics are the means by which the software quality can be measured; they give you confidence in the product.

 

Energize your test team

You're waist deep in your third month of late nights, weekends, and shipping stress; you can see and feel your team's energy waning.

 

The Value of Positive Testing

There is a school of thought in software testing that debunks the value of positive testing. This school basically states that any test that does not produce a defect is not a good test.

Blog Archive