Qtp Interview Questions For Experienced - Latest Updated
1. Explain the QTP Tool interface?
Answer:
QTP Tool interface contains the following key elements:
- Title bar: displaying the name of the currently open test
- Menu bar: dispel. saying menus of QuickTest commands
- File toolbar: containing buttons to assist you in managing tests
- Test toolbar: containing buttons used while creating and maintaining tests
- Debug toolbar: containing buttons used while debugging tests.
- Action toolbar: containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow.
- Test pane: containing two tabs to view your test-the Tree View and the Expert View
- Test Details pane: containing the Active Screen
- Data Table: containing two tabs, Global and Action, to assist you in parameterizing your test
- Debug Viewer pane: containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.)
- Status bar: displaying the status of the test. The Action toolbar is not displayed when you open QuickTest for the first time. You can display the Action toolbar by choosing View > Toolbars > Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically.
2. Can an action have 2 shared object repositories associated with them? In that case, if two of them contain the same object, which one will be considered?
Answer: There can be more than one Shared OR’s associated with the same action. If Shared OR1 and Shared OR2 have one object named OBJ1 each and if the action calls for OBJ1 then the order in which the shared ORs were associated will be considered. That means, if Shared OR1 was first associated then the OBJ1 from Shared OR1 will be taken into account.
3. Explain about the Test Fusion Report of QTP?
Answer: Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screenshots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.
4. How to use the Object spy in QTP 8.0 version?
Answer: There are two ways to Spy the objects in QTP: 1) Thru file toolbar, In the File, Toolbar click on the last toolbar button (an icon showing a person with hat). 2) True Object repository Dialog, In Object repository dialog, click on the button object spy. In the Object spy Dialog click on the button showing hand symbol. The pointer now changes into a hand symbol and we have to point out the object to spy the state of the object if at all the object is not visible. or window is minimized then, hold the Ctrl button and activate the required window to and release the Ctrl button.
5. Explain the concept of how QTP identifies object.?
Answer: During recording, QTP looks at the object and stores it as a test object. For each test object, QT learns a set of default properties called mandatory properties, and look at the rest of the objects to check whether these properties are enough to uniquely identify the object. During the test run, QTP searches for the runtime objects that match with the test object it learned while recording.
6. Differentiate the two Object Repository Types of QTP?
Answer: Object repository is used to store all the objects in the application being tested.
Types of object repository: Per action and shared repository.
In a shared repository only one centralized repository for all the tests, whereas in per action for each test a separate per action repository is created.
7. What is the use of Text output value in QTP?
Answer: Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.
8. What are the Features & Benefits of Quick Test Pro (QTP 8.0)?
Answer: Operates stand-alone or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation zero-configuration Keyword Driven testing technology in Quick Test Professional 8.0 allowing for fast test creation, easier maintenance, and more powerful data-driving capability. Identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended script execution. Collapses test documentation and test creation to a single step with Auto-documentation technology. Enables thorough validation of applications through a full complement of checkpoints.
9. What is the difference between Call to Action and Copy Action?
Answer: Call to Action: The changes made in Call to Action will be reflected in the original action (from where the script is called). But whereas in Copy Action, the changes made in the script, will not affect the original script(Action)
10. How do you know the location Id of an object if you know its index id?
Answer: Location is the position of the object from left to right and top to bottom within the parent window, frame, or dialog box relative to other similar objects.
Index Id is the order in which the object appears in your AUT relative to other similar objects. E.g if you have 2 links, then index id=0 will be the first link and index id=1 will be the second link.
The answer to this question is entirely dependent on where the object lies, whether it is within the same parent or not.
11. What is Cross-Site Scripting?
Answer: Cross-Site Scripting is a thread in the dynamic website. It is also known as XSS. Cross-site scripting occurs when a web application gathers malicious data from a user. The data is collected in the hyperlinked form which contains malicious content within it. It allows malicious code to be inserted into the web page. The web page can be a simple HTML code or a client-side script. When the malicious code is inserted in page and clicked by some user, the malicious code becomes a part of the web request of the user. This request can also execute on the user’s computer and steal information.
12. What is throw object?
Answer: VB Script does not have any specific throw object. (At least to the best of my knowledge) This question will not come up unless a specific add-in that supports this feature is explored.
13. What is the use of Ordinal identifier in QTP?
Answer: Ordinal Identifiers are used to initialize the value to the object which is in numeric form and it is used to find out its order with respect to other objects. QTP enable us with the following types of Ordinal Identifiers:
- Index: indicates the order of object.
- Location: determine the location of the object like inside the parent window, frame or dialog box relative to other objects.
- Creation Time: determine the order in which web browser open.
14. Why do we use breakpoints in QTP?
Answer: This is to stop the execution of your test at a certain point while it’s running. Typically it is used to observe the state of your application or to understand how a certain feature works at a certain phase at runtime.
15. What is a reusable action?
Answer: An action that can be called multiple times within or outside the same test is called the reusable action. By default all actions are reusable.
16. How do you capture tooltip using QTP?
Answer: Tool Tip capture method varies depending on the type of object this tooltip appears for. It could be for links, images or any other web element.
17. How many ways we can parameterize data in QTP?
Answer: There are four types of parameters: Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test. Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition or iteration, Quick Test uses a different value from the Data Table. Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply or values that Quick Test generates for you based on conditions and options you choose. Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have Quick Test generate a random number and insert it in a number of the tickets edit field.
18. What is the Diff between Image check-point and Bit map Check point?
Answer: Image checkpoints enable you to check the properties of a Web image. 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. Quick Test 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. 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.
19. I have developed and executed a script successfully, and saved the same to QC. When I tried to execute the script from QC, the script is not executing. What are the possible reasons?
Answer:
- Firstly, QuickTest Add-In for Quality Center has to be installed.
- In the QTP Tools > Options > run tab you should have ‘Allow other Mercury products to run tests and components’ selected.
- Make sure you are running QTP as an Admin
- All the test resources have to be in the correct path
20. If the objects hierarchy is changing from build to build, then how you will handle that condition?
Answer: In this case, the descriptive programming can be used instead of having an OR. Even while descriptive programming tries to use regular expressions to identify the unique property of the objects.
21. What is an object repository?
Answer: OR is like a warehouse where all the objects in a test are stored. OR has the list of Objects that QTP learned during the recording process and the class to which they belong. It stores the set of properties that uniquely identify the Object (description) and also names the object for the sake of identification in our test, based on its most prominent feature.
22. What are the advantages of test automation?
Answer:
Time – It produces quick results
No Manual intervention
Cost-effective
Not prone to human errors
23. What are the different recording modes and how do they work?
Answer:
QTP provides 3 modes of recording:
- Normal Recording mode – The default recording method is always the normal mode. This method uses the model of Test Objects and Runtime objects to learn and act on the AUT.
- Analog recording mode – records the exact mouse and keystrokes that the user performs in relation to either the screen or AUT window. The steps that are recorded using this method cannot be edited.
The way this usually gets represented in code is:
Window/app.RunAnalog “Track1”
One scenario in which this type of recording can be used is when we are trying
to capture a signature.
- Low-Level recording mode – This mode records the coordinates in the application where the operation is performed, irrespective of whether QTP recognizes the specific Object or Operation.
24. What is QTP’s model for test creation?
Answer:
- Determine testing needs – Define testing environment, Analyse your application and plan actions
- Set up repositories – Local or Shared OR
- Define function libraries
- Generate test steps – Add steps, Add checkpoints
- Data drive your tests
- Run the tests
25. Explain the views in the QTP GUI?
Answer:
Keyword view: This view is a tabular representation of all the objects and the actions that are performed on them. Every row in the table is a step performed on the AUT and can be modified. Some of the most common columns displayed are an item, operation, value, and documentation.
Expert view: As the name indicates, this view is for more technical users who would want to tweak the source code as per their requirements.
26. What is the test object model in QTP?
Answer: The test object model is a large set of object types or classes that Quick Test 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 Quick Test can record for it. A test object is an object that Quick Test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identify and check the object during the run session.
27. What are Parameterizing Tests?
Answer: When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose 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.
28. In how many ways we can add checkpoints to an application using QTP?
Answer: We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note: To perform the second one The Active screen must be enabled while recording).
29. Explain the check points in QTP?
Answer: 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. A page checkpoint checks the characteristics of an Application. A text checkpoint checks that a text string is displayed in the appropriate place on an Application. An object checkpoint (Standard) checks the values of an object on an Application. An image checkpoint checks the values of an image on an Application. A table checkpoint checks information within a table on an Application. An Accessibility checkpoint checks the web page for Section 508 compliance. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application. A database checkpoint checks the contents of databases accessed by your web site
30. What is the difference between QTP and Selenium?
Answer: QTP is not an open source tool while Selenium is an open source tool.
We can use QTP to test different kinds of applications like web, .net, java, mainframe, PeopleSoft, etc.
But Selenium is used only for Web application testing. QTP supports only vb script as a language but we can develop selenium scripts using JAVA, .Net, Ruby, Perl, etc.
31. How does QTP identify an object?
Answer: QTP has a predetermined set of properties that it learns/stores for every class of object it identifies.
There are 3 aspects to this:
- Mandatory properties: This is the list of properties for a certain class that QTP always stores. We could say that this is the object description. It also checks this in conjunction with the parent object to see if the description is sufficient to identify the object uniquely.
- Assistive properties: In case the description of mandatory properties is insufficient to identify the Object a set of non-mandatory properties will be added to the description one after the other until there is enough data to identify the object.
- Ordinal Identifier: If the assistive properties also do not result in the unique identification of an object a special ordinal identifier is added by QTP, such as the object’s location on the page or in the source code.
32. How does QTP recognize Objects in AUT?
Answer: Quick Test stores the definitions for application objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by Quick Test) and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the Quick Test 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.