Q. 1: Tell me briefly about QTP?
If you are going for a position related to QTP, you could expect this as the first question in the interview. The first step on the part of an interviewer is to make you comfortable with a basic question.
Hence try to remember maximum portion from the following content that should be presented to the interviewer if situation arises.
QTP is a graphical interface record-playback automation tool. It is able to work with any web, Java or windows client application. QTP enables you to test standard web objects and ActiveX controls. In addition to these environments, QTP also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic applications and .NET framework applications...
QTP is Mercury Interactive Functional Testing Tool.
Mercury QTP provides the industry's best solution for functional test and regression test automation - addressing every major software application and environment. This next-generation automated testing solution deploys the concept of Keyword-driven testing to radically simplify test creation and maintenance. Unique to QTP’s Keyword-driven approach, test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.
QTP enables you to test standard Windows applications, Web objects, ActiveX controls, and Visual Basic applications. You can also acquire additional QTP add-ins for a number of special environments (such as Java, Oracle, SAP Solutions, .NET Windows and Web Forms, Siebel, PeopleSoft, Web services, and terminal emulator applications).
<<<<<< =================== >>>>>>
Q. 2: What’s the basic concept of QTP?
QTP is based on two concepts like:
a) Recording
b) Playback
<<<<<< =================== >>>>>>
Q. 3: Which scripting language used by QTP?
QTP uses VB scripting.
<<<<<< =================== >>>>>>
Q. 4: How many types of recording facility are available in QTP?
QTP provides three types of recording methods like:
a) Context Recording (Normal)
b) Analog Recording
c) Low Level Recording
<<<<<< =================== >>>>>>
Q. 5: How many types of Parameters are available in QTP?
QTP provides three types of Parameters like:
a) Method Argument
b) Data Driven
c) Dynamic
<<<<<< =================== >>>>>>
Q. 6: What’s the testing process in QTP?
QTP testing process consist of seven steps like:
1) Preparing to recording
2) Recording
3) Enhancing your script
4) Debugging
5) Run
6) Analyze
7) Report Defects etc.
<<<<<< =================== >>>>>>
Q. 7: How to Start recording using QTP?
Choose Test > Record or click the Record button.
When the Record and Run Settings dialog box opens, to do this;
1) In the Web tab, select Open the following browser when a record or run session begins.
2) In the Windows Applications tab, confirm that Record and run on these applications (opened on session start) is selected, and that there are no applications listed.
<<<<<< =================== >>>>>>
Q. 8: How to insert checkpoints to an image to check enable property in QTP?
Answer - 1: If all images are like push button than you can check the property enabled or disabled.
If you are not able to find that property than go to object repository for that object and click on add remove to add the available properties to that object.
And if you take it as image than you need to check visible or invisible property, there are no enable or disable properties for the image object.
Answer - 2: The Image Checkpoint does not have any property to verify the enable/disable property.
Important aspects that needs to be checked are:
a) Find out form the Developer if he is showing different images for activating/deactivating i.e. grayed out image. That is the only way a developer can show deactivate/activate if he is using an "image". Else he might be using a button having a headsup with an image.
b) If it is a button used to display with the headsup as an image you would need to use the object Properties as a checkpoint.
<<<<<< =================== >>>>>>
Q. 9: How to save your test using QTP?
Select File > Save or click the Save button.
The Save dialog box opens to the Tests folder.
Create a folder which you want to save to, select it, and click Open.
Type your test name in the File name field.
Confirm that Save Active Screen files is selected.
Click Save.
Your test name is displayed in the title bar of the main QTP window.
<<<<<< =================== >>>>>>
Q. 10: How to Run a Test using QTP?
Step-1: Start QTP and open your test.
If QTP is not already open, choose Start > Programs > QuickTest Professional > QuickTest Professional.
# If the Welcome window opens, click Open Existing.
# If QTP opens without displaying the Welcome window, choose File > Open or click the Open button.
In the Open Test dialog box, locate and select your test, then click Open.
Step-2: Confirm that all images are saved to the test results.
QTP allows you to determine when to save images to the test results.
Choose Tools > Options and select the Run tab. In the Save step screen capture to test results option, select Always.
Click OK to close the Options dialog box.
Step-3: Start running your test.
Click Run or choose Test > Run. The Run dialog box opens.
Select New run results folder.
Accept the default results folder name.
Click OK to close the Run dialog box.
Rehearsal of QTP in 1 Hr: Interview Questions 11 – 20
While appearing in an interview for a position on HP QuickTest Professional, do a quick rehearsal of your knowledge on this tool.
Here is a collection of 180 short questions, QTP Managers commonly use while interviewing new aspirants for their organization.
The entire rehearsal of these questions can take less than an hour.
Set of Ten Questions
Q. 11: How to open a new test using QTP?
1) If QTP is not currently open:
Choose Start > Programs > QuickTest Professional > QuickTest Professional.
If the Welcome window opens, click Blank Test.
Otherwise, choose File > New, or click the New button.
A blank test opens.
2) If QTP is already open:
Check which add-ins are loaded by selecting Help > About QuickTest Professional.
If the Web Add-in is not loaded, you must exit and restart QTP.
When the Add-in Manager opens, select the Web Add-in, and clear all other add-ins.
Choose File > New, or click the New button.
A blank test opens.
<<<<<< =================== >>>>>>
Q. 12: How to do load testing for web based Application?
1) Recording a scenario in QTP of web based application.
2) Make 100 copies of that scenario and run the test (scenario run for 100 times)
3) In that case, do the load of application on server.
4) The basic logic of running the copy 100 times is to create same scenario as if 100 users were working.
<<<<<< =================== >>>>>>
Q. 13: What is the extension of script and object repository files?
Object Repository : .tsr , Script : .mts, Excel : Default.xls
<<<<<< =================== >>>>>>
Q. 14: How to suppress warnings from the "Test results page"?
From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".
<<<<<< =================== >>>>>>
Q. 15: When we try to use test run option "Run from Step", the browser is not launching automatically why?
This is default behavior.
<<<<<< =================== >>>>>>
Q. 16: What's the role of Checkpoints in QTP?
A checkpoint verifies that expected information is displayed in your application while the test is running. Checkpoint is basically a point in the test, which validates for truthfulness of a specific thing in the AUT.
There are different types of checkpoints depending on the type of data that needs to be tested in the AUT.
It can be text, image/bitmap, attributes, XML etc....
<<<<<< =================== >>>>>>
Q. 17: What types of checkpoints are offered by QTP?
There are 10 types of checkpoints you can insert in QTP:
1) Standard Checkpoint checks the property value of an object in your application or Web page. The standard checkpoint checks a variety of objects such as buttons, radio buttons, combo boxes, lists, etc.
2) Image Checkpoint checks the value of an image in your application or Web page. For example, you can check that a selected image’s source file is correct.
3) Bitmap Checkpoint checks an area of your Web page or application as a bitmap.
4) Table Checkpoint checks information within a table. For example, suppose your application or Web site contains a table listing all available flights from one place to another. You can add a table checkpoint to check that the time of the first flight in the table is correct.
5) Text Checkpoint checks that a text string is displayed in the appropriate place in your application or on a Web page.
6) Text Area Checkpoint checks that a text string is displayed within a defined area in a Windows application, according to specified criteria.
7) Accessibility Checkpoint identifies areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines.
8) Page Checkpoint checks the characteristics of a Web page. For example, you can check how long a Web page takes to load or whether a Web page contains broken links.
9) Database Checkpoint checks the contents of a database accessed by your application.
10) XML Checkpoint checks the data content of XML documents in XML files or XML documents in Web pages and frames.
<<<<<< =================== >>>>>>
Q. 18: How to add a standard checkpoint in your test?
1) Start QTP and open your test.
In the Open Test dialog box, locate and select your test, then click Open.
2) Save the test as Checkpoint.
Select File > Save As. Save the test as Checkpoint.
3) Confirm that the Active Screen option is enabled.
If you do not see the Active Screen at the bottom of the QTP window, click the Active Screen button, or choose View > Active Screen.
4) Locate the page where you want to add a standard checkpoint.
5) Create a standard checkpoint.
In the Active Screen, right-click element in your application and choose Insert Standard Checkpoint.
6) Save the test.
<<<<<< =================== >>>>>>
Q. 19: How to add a page checkpoint to your test?
The page checkpoint checks that the number of links and images in the page when you run your test is the same as when you recorded your test.
1) Locate the page where you want to add a page checkpoint.
2) Create a page checkpoint.
Right-click anywhere in the Active Screen, and choose Insert Standard Checkpoint.
The Object Selection - Checkpoint Properties dialog box opens.
Note that this dialog box may include different elements, depending on where you click in the Active Screen.
3) Save the test.
<<<<<< =================== >>>>>>
Q. 20: How run time data (Parameterization) is handled in QTP?
You can enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage.
Data can be typed in or imported from databases, spreadsheets, or text files.
Rehearsal of QTP in 1 Hr: Interview Questions 21 – 30
While appearing in an interview for a position on HP QuickTest Professional, do a quick rehearsal of your knowledge on this tool.
Here is a collection of 180 short questions, QTP Managers commonly use while interviewing new aspirants for their organization.
The entire rehearsal of these questions can take less than an hour.
Set of Ten Questions
Q. 21: What is keyword view and Expert view in QTP?
By QTP’s Keyword Driven approach, the test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.
Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that QTP automatically generates.
Any changes made in the Expert View are automatically synchronized with the Keyword View.
<<<<<< =================== >>>>>>
Q. 22: How QTP recognizes Objects in AUT?
QTP stores the definitions for application objects in a file called the Object Repository.
As you record your test, QTP will add an entry for each item you interact with.
Each Object Repository entry will be identified by a logical name (determined automatically by QTP), and will contain a set of properties (type, name, etc) that uniquely identify each object.
Each line in the QTP script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method).
The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.
<<<<<< =================== >>>>>>
Q. 23: What are the types of Object Repositories in QTP?
QTP has two types of object repositories for storing object information:
1) Shared object repositories and
2) Action object repositories.
You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test.
The object repository per-action mode is the default setting. In this mode, QTP automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files.
However, if you modify values in an action object repository, your changes do not have any effect on other actions. Hence, if the same test object exists in more than one action and if you modify an object's property values in one action, you may need to make the same change in every action (and any test) containing the object.
<<<<<< =================== >>>>>>
Q. 24: If I give some thousand tests to execute in 2 days what do you do?
Adhoc testing is done. It covers the least basic functionality to verify that the system is working fine.
<<<<<< =================== >>>>>>
Q. 25: How to "Turn Off" QTP results after running a Script?
Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this suppresses only the result window, but a log will be created and can be viewed manually which cannot be restricted from getting created.
<<<<<< =================== >>>>>>
Q. 26: Explain the Test Fusion Report of QTP?
Once a tester has run a test, a TestFusion report displays all aspects of the test run. This is a high-level results overview, an expandable Tree View of the test specifying the following:
# Exactly where application failures occurred,
# Test data used
# Application screen shots for every step that highlight any discrepancies
# Detailed explanations of each checkpoint pass and failure.
By combining TestFusion reports with QTP, you can share reports across an entire QA and development team.
<<<<<< =================== >>>>>>
Q. 27: QTP supports which environments?
QTP supports functional testing of all enterprise environments, including Windows, Web, ..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.
<<<<<< =================== >>>>>>
Q. 28: What are the elements of QTP Window?
Before beginning creation of the tests,, it is essential to familiarize with the main QTP window.
The QTP window contains the following key elements:
1) Title bar: Displays the name of the currently open test.
2) Menu bar: Displays menus of QTP commands.
3) File toolbar: Contains buttons to assist you in managing your test.
4) Testing toolbar: Contains buttons to assist you in the testing process.
5) Debug toolbar: Contains buttons to assist you in debugging tests.
6) Test pane: Contains the Keyword View and Expert View tabs.
7) Active Screen: Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.
8) Data Table: Assists you in parameterizing your test.
9) Debug Viewer pane: Assists you in debugging your test.
The Debug Viewer pane contains the Watch Expressions, Variables, and Command tabs.
(The Debug Viewer pane is not displayed when you open QTP for the first time.
You can display the Debug Viewer by choosing View < Debug Viewer.)
10) Status bar: Displays the status of the QTP application.
<<<<<< =================== >>>>>>
Q. 29: How does QTP identifies the object in the application?
QTP identifies the object in the application by LogicalName and Class.
For example: The Edit box is identified by
Logical Name : PSOPTIONS_BSE_TIME20
Class: WebEdit
<<<<<< =================== >>>>>>
Q. 30: If an application name is changes frequently i.e. while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?
QTP handles those situations using "Regular Expressions.
Rehearsal of QTP in 1 Hr: Interview Questions 21 – 30
While appearing in an interview for a position on HP QuickTest Professional, do a quick rehearsal of your knowledge on this tool.
Here is a collection of 180 short questions, QTP Managers commonly use while interviewing new aspirants for their organization.
The entire rehearsal of these questions can take less than an hour.
Set of Ten Questions
Q. 21: What is keyword view and Expert view in QTP?
By QTP’s Keyword Driven approach, the test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.
Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that QTP automatically generates.
Any changes made in the Expert View are automatically synchronized with the Keyword View.
<<<<<< =================== >>>>>>
Q. 22: How QTP recognizes Objects in AUT?
QTP stores the definitions for application objects in a file called the Object Repository.
As you record your test, QTP will add an entry for each item you interact with.
Each Object Repository entry will be identified by a logical name (determined automatically by QTP), and will contain a set of properties (type, name, etc) that uniquely identify each object.
Each line in the QTP script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method).
The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.
<<<<<< =================== >>>>>>
Q. 23: What are the types of Object Repositories in QTP?
QTP has two types of object repositories for storing object information:
1) Shared object repositories and
2) Action object repositories.
You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test.
The object repository per-action mode is the default setting. In this mode, QTP automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files.
However, if you modify values in an action object repository, your changes do not have any effect on other actions. Hence, if the same test object exists in more than one action and if you modify an object's property values in one action, you may need to make the same change in every action (and any test) containing the object.
<<<<<< =================== >>>>>>
Q. 24: If I give some thousand tests to execute in 2 days what do you do?
Adhoc testing is done. It covers the least basic functionality to verify that the system is working fine.
<<<<<< =================== >>>>>>
Q. 25: How to "Turn Off" QTP results after running a Script?
Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this suppresses only the result window, but a log will be created and can be viewed manually which cannot be restricted from getting created.
<<<<<< =================== >>>>>>
Q. 26: Explain the Test Fusion Report of QTP?
Once a tester has run a test, a TestFusion report displays all aspects of the test run. This is a high-level results overview, an expandable Tree View of the test specifying the following:
# Exactly where application failures occurred,
# Test data used
# Application screen shots for every step that highlight any discrepancies
# Detailed explanations of each checkpoint pass and failure.
By combining TestFusion reports with QTP, you can share reports across an entire QA and development team.
<<<<<< =================== >>>>>>
Q. 27: QTP supports which environments?
QTP supports functional testing of all enterprise environments, including Windows, Web, ..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.
<<<<<< =================== >>>>>>
Q. 28: What are the elements of QTP Window?
Before beginning creation of the tests,, it is essential to familiarize with the main QTP window.
The QTP window contains the following key elements:
1) Title bar: Displays the name of the currently open test.
2) Menu bar: Displays menus of QTP commands.
3) File toolbar: Contains buttons to assist you in managing your test.
4) Testing toolbar: Contains buttons to assist you in the testing process.
5) Debug toolbar: Contains buttons to assist you in debugging tests.
6) Test pane: Contains the Keyword View and Expert View tabs.
7) Active Screen: Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.
8) Data Table: Assists you in parameterizing your test.
9) Debug Viewer pane: Assists you in debugging your test.
The Debug Viewer pane contains the Watch Expressions, Variables, and Command tabs.
(The Debug Viewer pane is not displayed when you open QTP for the first time.
You can display the Debug Viewer by choosing View < Debug Viewer.)
10) Status bar: Displays the status of the QTP application.
<<<<<< =================== >>>>>>
Q. 29: How does QTP identifies the object in the application?
QTP identifies the object in the application by LogicalName and Class.
For example: The Edit box is identified by
Logical Name : PSOPTIONS_BSE_TIME20
Class: WebEdit
<<<<<< =================== >>>>>>
Q. 30: If an application name is changes frequently i.e. while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?
QTP handles those situations using "Regular Expressions.
Rehearsal of QTP in 1 Hr: Interview Questions 31 – 40
While appearing in an interview for a position on HP QuickTest Professional, do a quick rehearsal of your knowledge on this tool.
Here is a collection of 180 short questions, QTP Managers commonly use while interviewing new aspirants for their organization.
The entire rehearsal of these questions can take less than an hour.
Set of Ten Questions
Q. 31: Briefly explain the utility of Table and Database Checkpoints?
By adding table checkpoints to your tests or components, you can check:
a) That a specified value is displayed in a cell in a table on your application.
b) The contents of databases accessed by your application.
The results displayed for table and database checkpoints are similar. When you run your test or component, QTP compares the expected results of the checkpoint to the actual results of the run session. If the results do not match, the checkpoint fails.
You can check that a specified value is displayed in a cell in a table by adding a table checkpoint to your test or component. For ActiveX tables, you can also check the properties of the table object.
To add a table checkpoint, you use the Checkpoint Properties dialog box. Table checkpoints are supported for Web and ActiveX applications, as well as for a variety of external add-in environments.
You can use database checkpoints in your test or component to check databases accessed by your Web site or application and to detect defects. You define a query on your database, and then you create a database checkpoint that checks the results of the query.
Database checkpoints are supported for all environments supported by QTP, by default, as well as for a variety of external add-in environments.
There are two ways to define a database query:
a) Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office.
b) Manually define an SQL statement.
The Checkpoint timeout option is available only when creating a table checkpoint. It is not available when creating a database checkpoint
<<<<<< =================== >>>>>>
Q. 32: How do you check Bitmaps?
You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QTP captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space.
When you run the test or component, QTP compares the object or selected area of the object currently displayed on the Web page or application with the bitmap stored when the test or component was recorded. If there are differences, QTP captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), you can identify the nature of the discrepancy. For more information on test results of a checkpoint, see Viewing Checkpoint Results.
For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded).
The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.
<<<<<< =================== >>>>>>
Q. 33: Briefly explain the utility of Text/Text Area Checkpoint?
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.
In Windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane displays [complex value] instead of the selected text string. You can then click Configure to view and manipulate the actual selected text for the checkpoint.
QTP automatically displays the Checked Text in red and the text before and after the Checked Text in blue. For text area checkpoints, only the text string captured from the defined area is displayed (Text Before and Text After are not displayed). To designate parts of the captured string as Checked Text and other parts as Text Before and Text After, click the Configure button. The Configure Text Selection dialog box opens
Checking XML :
XML (Extensible Markup Language) is a meta-markup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structures portable between different computer environments/operating systems and programming languages, facilitating the sharing of data.
XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data.
You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described below:
An XML file can be a static data file that is accessed in order to retrieve commonly used data for which a quick response time is needed—for example, country names, zip codes, or area codes. Although this data can change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another.
An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, your application's ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed.
XML files are often an intermediary that retrieves dynamically changing data from one system. The data is then accessed by another system using Document Type Definitions (DTD), enabling the accessing system to read and display the information in the file. You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way.
XML documents and files often need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML schema, which describes the structure of the XML elements and data types. You can use schema validation to check that each item of content in an XML file adheres to the schema description of the element in which the content is to be placed.
<<<<<< =================== >>>>>>
Q. 34: What are the Features & Benefits of QTP?
1) Key word driven testing
2) Suitable for both client server and web based application
3) VB script as the script language
4) Better error-handling mechanism
5) Excellent data driven testing features
6) Operates stand-alone, or integrated into HP Business Process Testing and HP Quality Center.
It introduces next-generation zero-configuration Keyword Driven testing technology in QTP allowing for fast test creation, easier maintenance, and more powerful data-driving capability.
It identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended script execution.
It collapses test documentation and test creation to a single step with Auto-documentation technology.
It enables thorough validation of applications through a full complement of checkpoints.
<<<<<< =================== >>>>>>
Q. 35: How to handle the exceptions using recovery scenario manager in QTP?
You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario.
Recovery scenario has three steps
1) Triggered Events
2) Recovery steps
3) Post Recovery Test-Run
<<<<<< =================== >>>>>>
Q. 36: What information does the columns in the Keyword View provide for each step?
As you recorded your test, QTP generated steps in the Keyword View representing each operation you performed in the Web browser.
The columns in the Keyword View show different information for each step, as follows:
1) Item: Displays the item for the step (test object, utility object, function call, or statement) in a hierarchical icon-based tree.
2) Operation: The operation to be performed on the item, for example, Click or Select.
3) Value: The argument values for the selected operation, for example, the mouse button to use when clicking the image.
4) Assignment: The assignment of a value to or from a variable so you can use the value later in the test.
5) Comment: Any textual information you want to add regarding the step, for example, Return to page used in first step of the test.
6) Documentation: Auto-documentation of what the step does, in an easy-to-understand sentence, for example, Click the "findFlights" image.
<<<<<< =================== >>>>>>
Q. 37: Why do we use Regular Expressions?
We create a text checkpoint for searching a specific text string. We can use regular expressions to increase the flexibility and adaptability of your tests.
Regular expressions enable QTP to identify objects and text strings with varying values.
You can use regular expressions when defining the properties of an object, the methods of an argument, when parameterizing a step, and when creating checkpoints with varying values.
<<<<<< =================== >>>>>>
Q. 38: Explain QTP Testing process ?
The QTP testing process consists of 6 main phases:
1) Create your test plan: Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
2) Recording a session on your application: As you navigate through your application, QTP graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
3) Enhancing your test:
# Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly.
Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process.
# Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data.
# Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
4) Debugging your test: If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
5) Running your test on a new version of your application: You run a test to check the behavior of your application. While running, QTP connects to your application and performs each step in your test.
6) Analyzing the test results: You examine the test results to pinpoint defects in your application.
7) Reporting defects: As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.
<<<<<< =================== >>>>>>
Q. 39: What is parameterizing of Tests?
When you test your application, you may want to check how it performs the same operations with multiple sets of data.
For example, you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data.
Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.
<<<<<< =================== >>>>>>
Q. 40: What is test object model in QTP?
The test object model is a large set of object types or classes that QTP uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that QTP can record for it.
A test object is an object that QTP creates in the test or component to represent the actual object in your application. QTP stores information about the object that will help it identify and check the object during the run session.
A run-time object is the actual object in your Web site or application on which methods are performed during the run session.
When you perform an operation on your application while recording, QTP:
# Identifies the QTP test object class that represents the object on which you performed the operation and creates the appropriate test object
# Reads the current value of the object’s properties in your application and stores the list of properties and values with the test object
# Chooses a unique name for the object, generally using the value of one of its prominent properties
# Records the operation that you performed on the object using the appropriate QTP test object method
QTP identifies the object that you clicked as a WebButton test object.
It creates a WebButton object with the name Find, and records the following properties and values for the Find WebButton:
It also records that you performed a Click method on the WebButton.
QTP displays your step in the Keyword View like this:
QTP displays your step in the Expert View like this:
Browser("Mercury Interactive").Page("Mercury Interactive").
WebButton("Find").
Q. 41: How to analyze the test results using QTP?
When QTP finishes running the test, the Test Results window opens.
Initially, the Test Results window contains two panes for displaying the key elements of your test run.
# The left pane displays the results tree, an icon-based view of the steps that were performed while the test was running. The results tree is organized according to the Web pages visited during the test run and can be expanded (+) to view each step.
The steps performed during the test run are represented by icons in the tree. You can instruct QTP to run a test or action more than once using different sets of data in each run. Each test run is called iteration, and each iteration is numbered. (The test you ran had only one iteration.)
# The right pane displays the test results details. The iteration summary table indicates which iterations passed and which failed. The status summary table indicates the number of checkpoints or reports that passed, failed, and raised warnings during the test.
View the test results for a specific step.
In the results tree, expand (+) Test Recording Summary > Recording Iteration 1 (Row 1) > Action1 Summary > your application > your test name.
The Test Results window now contains three panes, displaying:
# The results tree, with one step highlighted
# The test results details of the highlighted step
# The Active Screen, showing a screen capture of the Web page on which the step was performed.
When you click a page in the results tree, QTP displays the corresponding page in the application view. When you click a step (an operation performed on an object) in the results tree, the corresponding object is highlighted in the application view. In this case, the Departing From text box is highlighted.
<<<<<< =================== >>>>>>
Q. 42: Briefly tell me about the checkpoints in QTP?
A checkpoint verifies that expected information is displayed in an application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.
1) A page checkpoint checks the characteristics of an application
2) A text checkpoint checks that a text string is displayed in the appropriate place on an application
3) An object checkpoint (Standard) checks the values of an object on an application
4) An image checkpoint checks the values of an image on an application
5) A table checkpoint checks information within a table on an application
6) An Accessibility checkpoint checks the web page for statutory compliance.
7) An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.
8) A database checkpoint checks the contents of databases accessed by your web site
<<<<<< =================== >>>>>>
Q. 43: In how many ways we can add checkpoints to an application using QTP?
We can add checkpoints while recording the application or we can add after recording is completed using Active screen
To perform the second one The Active screen must be enabled while recording
<<<<<< =================== >>>>>>
Q. 44: Explain the Automation Object Model of QTP in brief?
Essentially all configuration and run functionality provided via the QTP interface is in some way represented in the QTP automation object model via objects, methods, and properties.
Although a one-on-one comparison cannot always be made, most dialog boxes in QTP have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods.
You can use the objects, methods, and properties exposed by the QTP automation object model, along with standard programming elements such as loops and conditional statements to design your program.
<<<<<< =================== >>>>>>
Q. 45: Briefly explain the QTP Environment.
QTP environment uses the graphical interface and ActiveScreen technologies - A testing process for creating test scripts, relating manual test requirements to automated verification features - Data driving to use several sets of data using one test script.
<<<<<< =================== >>>>>>
Q. 46: Explain the concept as to how QTP identifies object.
During recording QTP looks at the object and stores it as test object.
For each test object QTP learns a set of default properties called mandatory properties, and look at the rest of the objects to check whether this properties are enough to uniquely identify the object.
During test run, QTP searches for the run time objects that matches with the test object it learned while recording.
<<<<<< =================== >>>>>>
Q. 47: Explain the Object Repositories types, Which & when to use?
Deciding Which Object Repository Mode to Choose
To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes.
In general, the object repository per-action mode 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 mode is generally the preferred mode when:
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.
<<<<<< =================== >>>>>>
Q. 48: Can we script any test case with out having Object repository? Or Using Object Repository is a must?
No. You can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.
<<<<<< =================== >>>>>>
Q. 49: How to execute a WinRunner Script in QTP?
a) TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP used for backward compatibility Parameters : The test set within Quality Center, in which test runs are stored.
Note that this argument is relevant only when working with a test in a Quality Center project.
When the test is not saved in Quality Center, this parameter is ignored.
e.g : TSLTest.RunTest "D:\test1", ""
b) TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ] TSLTest.RunTestEx "C:\WinRunner\Tests\basic_flight", TRUE, FALSE, "MyValue" CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run ends. Parameters : Up to 15 WinRunner function argument
<<<<<< =================== >>>>>>
Q. 50: Why should we divide a test into three action calls?
When you create a new test, it contains a call to one action.
By dividing your tests into calls to multiple actions, you can design more modular and efficient tests.