QTP Interview Questions and Answers
Question - 31 : - Can we call QTP test from another test using scripting. Suppose there are 4 tests and I want to call these tests in a main script. Is this possible in QTP?
Answer - 31 : -
Yes. You can call 4 or even more scripts in your tests.For this, first you will need to make the Actions in the corresponding scripts re-usable.Then from the destination script you can make calls to these re-usable actions.
Question - 32 : - What is action split and the purpose of using this in QTP?
Answer - 32 : -
Action split is to divide an existing action into two parts.The purpose is to divide actions based on their functionality to improve code re-use.
Question - 33 : - How will you handle Java tree in QTP?
Answer - 33 : -
Foremost you will select Java Add – In and launch QTP. Next step record operations on the Java Tree. If you face an issue while recording, you can select Tools > Object Identification > Java, tree object and make changes in mandatory and assistive properties to enable identification.
Question - 34 : - Explain how QTP identifies object?
Answer - 34 : -
QTP identifies any GUI Object based on its corresponding properties. While recording, QTP will identify and store peculiar properties (as defined in the Object Identification settings) in the object repository of the GUI object . At run-time, QTP will compare the stored property values with the on-screen properties, to uniquely identify the GUI object.
Question - 35 : - How many types of recording modes in QTP? Which will be used when?
Answer - 35 : -
QTP supports 3 types of recording modes
1. Normal mode also called Contextual
2. Low-level recording mode
3.Analog mode
Normal Mode: It is the default recording mode and takes full advantage of QTP’s Test Object Model. It recognizes objects regardless of their position on -screen. This is the preferred mode of recoding and is used for most of the automation activities.
Low-level recording mode: This mode records the exact x,y co-ordinates of your mouse operations. It is helpful in testing hashmaps. It is useful for recording objects not identified by normal mode of QTP.
Analog mode: This mode records exact mouse and keyboard “movements” you perform in relation to the screen / application window. This mode is useful for the operation such as drawing a picture, recording signature., drag and drop operations.
Question - 36 : - How will you call from one action to another action?
Answer - 36 : -
We can call an action in 2 ways
1) Call to copy of Action. – In this ,the Action Object Repository , Script and Datable will be copied to the destination Test Script.
2) Call to Existing Action. – In this, Object Repository , Script and Datable will NOT be copied but a call (reference) would be made to the Action in the source script.
Question - 37 : - What are Virtual Objects?
Answer - 37 : -
Your application may contain objects that behave like standard objects but are not recognized by QTP. You can define these objects as virtual objects and map them to standard classes, such as a button or a check box. QTP emulates the user’s action on the virtual object during the run session. In the test results, the virtual object is displayed as though it is a standard class object.
For example, suppose you want to record a test on a Web page containing a bitmap that the user clicks. The bitmap contains several different hyperlink areas, and each area opens a different destination page. When you record a test, the Web site matches the coordinates of the click on the bitmap and opens the destination page.
To enable QTP to click at the required coordinates during a run session, you can define a virtual object for an area of the bitmap, which includes those coordinates, and map it to the button class. When you run a test, QTP clicks the bitmap in the area defined as a virtual object so that the Web site opens the correct destination page.
Question - 38 : - How to perform Cross platform testing and Cross browser testing using QTP? Can u explain giving some example?
Answer - 38 : -
You will need to create separate Actions which take care of different OS and Browsers
Cross Platform Testing:
Using the Built in Environment Variable you can dig up the OS information.
Eg. Platform = Environment(“OS”). Then based on the Platform you need to call the actions which you recorded on that particular platform.
Cross Browser Testing:
Using this code Eg. Browser(“Core Values”).GetROProperty(“version”) you can extract the Browser and its correspondin version. Ex: Internet Explorer 6 or Netscape 5. Based on this value you call the actions which are relevant to that browser.
Question - 39 : - What is logical name of the object?
Answer - 39 : -
Logical name is a name given by QTP while creating an object in the repository to uniquely identify it from other objects in the application. This name would be used by the QTP to map the object name in script with its corresponding description in the object repository. Ex: Browser(“Browser”).Page(“Guru99”) Here Guru99 is the logical name of the object.
Question - 40 : - What is descriptive programming?
Answer - 40 : -
Typically ,an object and its properties must be recorded in the Object Repository to enable QTP to perform action s on it.
Using descriptive programming , you do not store the object and its property values in the Object repository but mention the property value pair directly in the script.
The idea behind descriptive programming is not bypass the object repository but help recogonize dynamic objects.