Pages

Friday, 12 July 2013

QTP Interview Questions and Answers with Some Useful Interview Tips


Below are some useful tips to prepare for QTP interview, followed by the most common QTP interview questions and answers. Actually we had planned this post at the end of our QTP training article series. But many readers requested to provide interview questions so that you can prepare for interview while learning QTP.
Note – In this post we have covered some useful tips to prepare for QTP interview along with top 20 common and crucial Quick Test Professional questions and answers. Please provide more questions in comments and we’ll update this post with answers to your questions. You can also post your questions using this “Share Your QTP Interview Questions” page.
We devised a list of pre-requisites or non-technical aspects that every QTP interviewee has to be familiar with.

Here are some useful tips to prepare for QTP interview:

QTP Questions
  • QTP is merely a tool that facilitates testing. The ultimate goal of QTP- or any other testing tool for that matter- is efficient and effective testing. So, make sure your testing fundamentals are solid.
  • Next undeniably is the knowledge about the QTP tool. Make sure you know all the basic information about the tool.
  • QTP predominantly relies on a tester’s programming skills to design, develop and maintain tests. That does not mean knowing all the features of the tool or VB Script are enough. The most important skill the automation tester should have is the ability for logic building. QTP tool and VB Script are simply vehicles that help you reach a solution.
  • In the recent days most interviewers are asking questions that either involve writing a script on paper or coding on a QTP installed machine. If you can code on a machine or write the code spontaneously, that’s great! If not, I suggest you to write the solution to the problem given to you in simple English statements. This will give a chance to show case your solution forming ability. Explain that to translate this solution into a program is simply a matter of referring to the help files of the programming language to find the equivalent statements.
  • In an interview, when you are writing code, please do not forget to include comments. Showcase good programming practices.
  • Before attending a QTP interview, be sure to know the version of the QTP, the add-ins that you use, the versions of all the other software you are using etc.
  • If you have not been using QTP recently but have had past experience, it helps to take a couple of hours to re-familiarize with the IDE.
The most common but crucial questions that are asked in the QTP interview. The best part of these questions is that you have time to prepare an answer in advance before even the interview begins.
  1. What are the reasons for choosing to automate your project and why did you choose QTP?
  2. What is the most challenging testing situation you faced and how did you overcome it?
  3. Did QTP prove efficient for your project? Yes or No, explain?
  4. How did you achieve reusability via QTP?
  5. Did you find anything in your project that QTP proved inefficient to perform?
  6. Under what conditions would you recommend QTP for future projects?
We suggest you spend some time with these questions and come up with answers based on your practical experience from using QTP in your respective projects.
Another important question that your interviewer would be interested to know is the statistics. For example:
  1. How many scripts did you have?
  2. How often were they executed?
  3. How many lines of code in each script?
  4. Did you use function libraries and/or shared ORs?
  5. How long to develop a script?
  6. Did the scripts need lot of maintenance? If yes, why?
Again, be sure to be prepared with the answers to these questions.
Last piece of advice, be honest and straightforward. Keep in mind that not all projects are same and not everybody follows the same methods. So we recommend that you have clear understanding of your project and exhibit the potential to learn. Nobody expects you to know everything; they only expect you to know what you do best.
Let’s move on to the technical QTP questions.

QTP Interview Questions and Answered

Top 20 Most Asked QuickTest Professional Interview Questions
1) Different types of QTP test assets and their extensions:
types of QTP test assets and their extensions
2) Technologies supported by QTP:
Web, Java (Core and Advanced), .Net, WPF, SAP, Oracle, Siebel, PeopleSoft, Delphi, Power Builder, Stingray 1, Terminal Emulator, Flex, Web Services, Windows Mobile, VisualAge Smalltalk, Silverlight and mainframe terminal emulator
3) Does QTP run in any environment?
No, QTP works only in the windows environment.
4) Explain the views in the QTP GUI?
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: 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.
5) What is QTP’s model for test creation?
a) Determine testing needs – Define testing environment, Analyse your application and plan actions
b) Set up repositories – Local or Shared OR
c) Define function libraries
d) Generate test steps – Add steps, Add checkpoints
e) Data drive your tests
f) Run the tests
6) What are the different kinds of test steps?
5 types of steps:
- Test Object ( Performs actions on a TO)
- Functions
- Utility (Steps to control run session. Eg: Reporter.report)
- Comment
- Programming logic (Loop, conditions…etc)
7) What are the different ways to invoke an application using QTP?
a) SystemUtil.Run
SystemUtil.Run ( FileName, Parameters, Path, Operation )
Example: SystemUtil.Run(“iexplorer.exe”,http://www.google.com)
SystemUtil.Run(“test.txt”, “”,”C:\”,”1”)
b) InvokeApplication
Example: InvokeApplication “C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.google.com”

c) Creating a shell object using VB Script
Example: Create a “WScript.shell” object.
Dim testshell
Set testshell= CreateObject (“Wscript.shell”)
testshell.run “%windir%\notepad “
8) What are the different recording modes and how do they work?
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 key strokes 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 a 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 co-ordinates in the application where the operation is performed, irrespective of whether QTP recognizes the specific Object or Operation.
9) Which recording modes need more memory?
Analog and Low-level recording modes
10) Is it possible to switch between recording modes during a test creation?
Yes, in the middle of recording, we can switch to Analog/Low-level mode, finish the task required and go back to normal recording. The switch to Analog mode is available only during recording and not during editing
11) Does Low level recording capture mouse movements?
No. Mouse movements are not captured.
12) How does QTP identify an object?
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 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.
13) What is Smart identification?
If the recorded description does not enable QTP to identify a specific object then QTP uses “Smart identification” mechanism.  It uses the following additional properties to identify the object
a) Base Filter Properties (primary) – The set of properties that cannot be changed without changing the object type
b) Optional Filter Properties (secondary) – additional properties that help identify the object uniquely.
14) What is Object Spy?
Object Spy is an extremely helpful tool that QTP has to view the properties and operations of an object in the AUT. It shows all the properties of the object and the corresponding values. It also shows the object hierarchy. It also has a provision that lets the users add a certain object to the OR.
15) What is an object repository?
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 record process and the class to which they belong. It stores the set of properties that uniquely identifies the Object (description) and also names the object for the sake of identification in our test, based on its most prominent feature.
16) What are the two types of repositories available, explain them?
Local and shared repository – these are the two kinds of available repositories.
Every action by default has a local repository of its own and has all the objects that are used within it.
Alternately, the tester can have a common repository for multiple actions so that all of them can share the objects that it contains. The common repository is called a shared OR.
17) An action has both shared and local OR associated to it and both have the same object in them. In the test which one will be considered?
If a local OR and Shared OR have an object with the same name, the action will consider the object in its local OR.
18) 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?
There can be more than one Shared OR’s associated to 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.
19) Can the user toggle between using Local OR and shared OR for the same action?
Yes, it is possible to switch between one or the other types of ORs at any time. To do so, the menu option is Test->Settings->Resources and choosing the options accordingly.
20) Are Shared ORs read only?
By default, shared ORs open as read only. To open them in order to edit them you will have to open them from Object Repository Manager.
“ORM->File->Enable Editing”
More QTP Interview QuestionHere is an old post for more QTP interview questions.

Over to you:

Interested in seeing more QTP questions? We are going to do more follow up QTP questions. Please post your questions on the above article and also let us know of any other QTP related questions that you would like to be answered.

No comments: