Introduction
Achieving proficiency in QuickTest Professional (QTP), now known as UFT, is critical to providing efficient and assured automation testing for functional and regression testing. In this list of QTP interview questions and answers, you’ll learn the fundamental and advanced concepts, including Object Repositories, Keyword-Driven Frameworks, Descriptive Programming, and Checkpoints. Being proficient in QTP/UFT helps you save tremendous manual testing effort and improve the delivery process, thus becoming a valuable asset to your organization in the field of automation testing.
Ready to become a certified automation testing expert? Develop your technical skills by registering for our professional UFT/QTP Training Certification Course in Chennai and begin your journey to mastering the world of automation testing.
List of QTP Interview Questions for Freshers
- What is QTP?
- Which terminologies does QTP support?
- Why is breakpoint usage used in QTP?
- How can the second open browser be closed?
- What drawbacks does QTP have?
- What separates the expert view from the keyword view?
- What does the term “object spy” mean?
- What is the object’s logical name?
- Define the term “.qrs file” in QTP.
- How does QTP identify objects?
- Which two categories of repositories are there?
- Why is action split used in QTP, and what does it mean?
- Which categories of frameworks are there in QTP?
- What distinguishing features does ADODB have?
- Which environment variables are there in QTP?
Check your knowledge level with our smart Knowledge Assessment Tool
Take Your Eligibility Report Instantly
Explore our QTP course syllabus to get started.
QTP Interview Questions and Answers for Freshers
1. What is QTP?
An automated functional testing tool is called QTP (Quick Test Professional). The testers can use automated regression testing with this tool to find any bugs or faults in the applications. Additionally, the tool makes a comparison between the expected and actual results.
2. Which terminologies does QTP support?
Terms like Web, WPF, SAP, Java (Core and Advanced), Oracle, Siebel, .Net, Delphi, Power Builder, PeopleSoft, Terminal Emulator, Stingray1, Web Services, Windows Mobile, Flex, VisualAge Smalltalk, Silverlight, and mainframe terminal emulators are among those that QTP supports.
3. Why is breakpoint usage used in QTP?
This is done to allow you to pause your test in the middle of running it. Usually, it’s used to keep an eye on your program’s status or to understand how a particular feature functions during a particular runtime phase.
4. How can the second open browser be closed?
The browser instance that launched first can be identified by looking at the “creation time” column. Put simply, this is a counter for each browser instance that is launched. For the first one, it starts at zero and goes up from there. To close the second open browser, use the following code:
Browser(“creationtime:=1”).Close
5. What drawbacks does QTP have?
- With QTP version 10, large tests now use a lot of memory and CPU power.
- Because QTP saves outputs in an HTML file rather than a text file, the resulting folder grows huge.
6. What separates the expert view from the keyword view?
The Keyword View is a symbol-based view that displays test stages in tabular form. Consequently, the documentation for the test stages is generated. Expert View provides a related VB script articulation for each test step in the Keyword View.
7. What does the term “object spy” mean?
Object Spy facilitates the process of selecting the run and test time object properties and methods for the application being tested. You can open Object Spy directly from the Object Repository Dialog Box or the toolbar. When it is advantageous to use descriptive programming.
8. What is the object’s logical name?
When QTP generates an item in the repository, it assigns it a logical name to make it easier for users to identify it from other things in the application. Using this name, the QTP would develop a content strategy for the item name and the related image in the article repository.
9. Define the term “.qrs file” in QTP.
The “Quicktest Recovery Scenario” addon serves as a representation of it. Recovery scenario managers give us the ability to manage special circumstances when running tests. You should store a recovery scenario you create in QTP as a.qrs file. Multiple situations could be detailed in ‘a.qrs’ file.
10. How does QTP identify objects?
QTP recognizes any GUI object based on its pertinent properties. When recording, QTP will look for and store odd attributes (as defined in the Object Identification settings) in the GUI object’s object repository. QTP will match the recorded property values with the on-screen properties to uniquely identify a GUI object during runtime.
11. Which two categories of repositories are there?
There are two kinds of repositories available: shared and local.
Every action has a local repository that contains all necessary objects by default. Alternatively, the tester might store all of their operations in a central repository and distribute the objects within. The shared repository is called a shared OR.
12. Why is action split used in QTP, and what does it mean?
Splitting an existing action into two sections is known as action splitting. To increase code reusability, activities are categorized according to their functionality.
13. Which categories of frameworks are there in QTP?
Among the QTP framework types are
- Linear Scripting
- Test Library Architecture Framework
- Data-Driven Testing Framework
- Keyword-Driven Framework
- Hybrid Framework
14. What distinguishing features does ADODB have?
ADODB.Connection, ADODB.Command, ADODB.Fields, and ADODB.Recordset are some of its characteristics.
15. Which environment variables are there in QTP?
Built-in environment variables (read-only), user-defined internal variables (read-only), and user-defined external variables (read/write) are the three types of environment variables in QTP.
Gain expertise in scripting with our QTP tutorial for beginners.
List of QTP Interview Questions for Experienced
- Describe the term “CreateObject” with an example.
- What types of environmental variables are there in QTP?
- What is Reporter.ReportEvent?
- Describe how to use QTP to read a registry key.
- How can system environment variables be obtained in QTP?
- Mention the procedures needed to send mail from Outlook in QTP.
- Describe how you can use QTP to retrieve data from a database.
Check your knowledge level with our smart Knowledge Assessment Tool
Take Your Eligibility Report Instantly
Explore our QTP project ideas for further learning.
QTP Technical Interview Questions and Answers for Experienced
1. Describe the term “CreateObject” with an example.
An automation object generates an automation object reference and returns it.
SYNTAX:
CreateObject(servername.typename [, location])
Arguments
servername: required – The object’s provider application’s name.
typename: required – The kind of object to be created, or it’s class.
location: Optional – The name of the network server that has to be used to generate the object.
Example: Set IE = CreateObject(“InternetExplorer.Application”)
2. What types of environmental variables are there in QTP?
Three categories of environment variables exist in QTP:
- Built-in (Read only)
- User-defined Internal (Read only)
- User-defined External (Read/Write)
The syntax to set the environment variable is as follows:
Environment.Value( “name”) = “SLA”
The syntax below can be used to retrieve the environment variable.
Environment.Value(“name”) — This will return the name as SLA.
Environment.Value(“OS”) — This will return your system OS
3. What is Reporter.ReportEvent?
The typical QTP technique for sending personalized messages to the test results window is Reporter.Reportvent.
Syntax
Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]
where
EventStatus = 0 or micPass
1 or micFail
2 or micDone
3 or micWarning
The status of the results might be anything, such as Pass, Fail, Warning, etc. A screenshot can also be sent to the test results box.
4. Describe how to use QTP to read a registry key.
The following example demonstrates how to read a registry key in QTP.
‘Create a shell object
Set MyShell= CreateObject (“WScript.Shell”)
Read the value of key from the registry
RegValue =MyShell.RegRead (varpathofkey)
‘The key’s path in the registry must be passed to the abovementioned function.’
e.g. HKCU\software\ie\settings
msgbox RegValue
5. How can system environment variables be obtained in QTP?
In QTP, there are three methods to obtain system environment variables.
Utilize the WSH shell object.
- Use the Win32_Environment Class from WMI.
- Obtain variables from the registry.
Set myShell = CreateObject (“WScript.Shell”)
WScript.Echo myShell.ExpandEnvironmentStrings( “%PATHEXT%” )
myShell=Nothing,
Output: .BAT;.CMD;.VBS;. VBE;. JS;. JSE
Other user variables supersede their equivalent system variables, such as TEMP.
Set myShell = CreateObject( “WScript.Shell” )
WScript.Echo myShell.ExpandEnvironmentStrings( “TEMP=%TEMP%” )
myShell=Nothing
Output:
TEMP:C:\DOCUME~1\You\LOCALS~1\Temp
6. Mention the procedures needed to send mail from Outlook in QTP.
In QTP, to send mail from Outlook,
Set Outlook = CreateObject (“Outlook.Application”)
Dim Message ‘As Outlook.MailItem
Set Message = Outlook.CreateItem(olMailItem)
With Message
.Subject = Subject
.HTMLBody = TextBody
.Recipients.Add (aTo)
Const olOriginator = 0
.Send
End With
7. Describe how you can use QTP to retrieve data from a database.
The code below must be followed to retrieve data from the database in QTP.
Set db= createobject (“ADODB.Connection”)
db.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\SLA\vb6\admission_project.mdb;
Persist Security Info= False”
Set rst=createobject(“ADODB.Recordset”)
rst.Open “select*from Course”, db, 3
id=rst. RecordCount
For i=0 to id-1
Print rst.field (0) & rst.fields (1) & rst.fields (2) & rst.fields (3)
rst.Movenext
Next
Conclusion
Success in a QTP/UFT interview depends upon proving your high-level expertise in VBScripting, Object Identification, and Automation Frameworks. The interviewer needs to know that you are not just a simple tool user but someone who can take things to the next level in handling Descriptive Programming, Virtual Objects, and Synchronization Points. The level of your knowledge in explaining Shared and Local Object Repositories and Recovery Scenarios will prove your worth in maintaining robust regression suites. With testing cycles getting shorter and shorter, your high-level expertise in API Testing Integration and ALM Connectivity will make you a top-notch automation architect.Ready to become a certified automation expert? Master the art of functional testing at our software training institute in Chennai.
