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 - 7 (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 - 7 (New)Tweet this Post

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


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


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


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


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

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


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


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


89. 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) Analysing Results


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


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


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


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


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


96. 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,


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

Read More: http://www.onestopsoftwaretesting.com/2008/12/understanding-and-configuring-smart.html


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


100. 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).

SPONSORED LINKS

Comments :

0 comments to “Answers to QTP Interview Questions - Part - 7 (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