QTP Latest Interview Questions and Answers Part-2
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.
12) What is descriptive programming?
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.
Learn more about Descriptive Programming
13)What are the properties you would use for identifying a browser & page when using descriptive programming ?
You can use the name property
We can also use the property “micClass”.
14)Can we record an application running on a remote machine using QTP ?
Yes .you can record remote application provided you are accessing application through the local browser not via remoter like citrix.
If you are still unable to record it is advisable install QTP and application, on the same machine
15) Explain the keyword CreateObject with an example.
Creates and returns a reference to an Automation object
SYNTAX: CreateObject(servername.typename [, location])
servername: Required. The name of the application providing the object.
typename : Required. The type or class of the object to create.
location : Optional. The name of the network server where the object is to be created.
Example : Set IE = CreateObject(“InternetExplorer.Application”)
16) Can you switch between Per-Action and Shared Object Repository ? If yes how ?
Yes .We can switch. Go to Test—>Settings—>Resources. Here you have an option to choose repositories.
17) What is Object Spy ? How to Use it ?
Object Spy helps in determining the run & test time object properties & methods of the application under test.
You can access object spy directly from the toolbar or from the Object Repository Dialog Box.
It is very useful during Descriptive Programming
Learn more about Object Spy
18) When ordinal identifiers alone can make an object unique then why they are not given top priority? Why it is first mandatory and next assistive. Why we cannot go for ordinal identifiers directly?
Consider the following –
a) If two objects are overlapped on each other than location based object recognition will fail.
b) If only index based recognition is used your script will work but script execution time will increase.
Hence mandatory and assistive properties are used.
19) What is the file extension of the code file in QTP?
Code file extension is script.mts
20) Explain in brief about the QTP Automation Object Model.
QTP Automation Object model deals with Automation of QTP itself. Almost all configuration and functionality provided by QTP is represented by QTP’s Automation Object Model . Almost all dialog boxes in QTP have a corresponding automation object which can set or retrieved using the corresponding properties or methods in the Automation Object Model.QTP Automation Objects can be used along with standard VB programming elements like iterative loops or conditional statements to help you design a script of choice.