IMPORTANT QTP INTERVIEW QUESTIONS AND ANSWERS
|
IMPORTANT QTP INTERVIEW QUESTIONS AND ANSWERS BY QUICKTESTPROTECH.BLOGSPOT.COM |
- What are the environments supported by QTP?
Ans; Oracle, Siebel, Java, SAP, Terminal Emulator, .Net, PeopleSoft etc
2. What is dim?
Ans: Visual Basic
uses the DIM (or "Dim") statement for any variable declaration. It
declares and allocates storage space for one or more variables.
- What is the difference between dim and redim?
Ans: Dim statement is used to formally declare a variable, where
as ReDim statement is used to resize a dynamic array that has already been formally declared.
4. What is a check point? What are the types of check points available?
Ans:
It is a
verification point that compares the Actual value of the specified property
with the expected value for that property of an object
Types of Check
Points:
1. Standard
Check point
2. Text Check
point
3. Text Area
Check point
4. Bitmap Check
point
5. Table check
point
6. Database
Check point
7. XML check
point
- How can we insert check points?
Ans:
Inserting
Standard Check point:
- Record the application , while recording
- Choose Insert > Checkpoint > Standard Check point
- Place the hand Icon in the respective object for which you
want to provide checkpoint
- Click on OK button in the Object selection popup
- Select properties
required to verify during run time in the Checkpoint Properties
window
- Specify required options in the dialog box Then click ok
- How will you control iteration of Test?
Ans: Test Iteration can be controlled from the Global Datatable and
choosing options from File-->Settings-->Run
7. What is
descriptive programming?
Ans:
QTP cannot take action
(Run) on an object until unless its object description is in the Object
Repository. But descriptive programming provides a way to perform action on
objects which are not in Object repository.
Descriptive Programming can be considered useful in following case:
1.The objects in the application are dynamic in nature
2.When you don’t want to use object repository at all.
3. When object repository is taking more space
8. What is a
dictionary object? When do we use it?
Ans:
Dictionary
object is similar to a typical array. The difference between a dictionary
object and an array is that there is a unique key associated with every item of
dictionary object. This unique key can help you in calling that item as and
whenever required.
When you want to
share data between different actions in a test, dictionary object can be used.
To do this you should create a reserved test object for the Dictionary object.
9. What is a
virtual object? When do we use it?
Ans: Virtual Object
wizard we can use configure to non standard object to standard object.
10. What is GetROProperty? When do we use it?
Ans: GetROProperty to get the
value of an object property during runtime, such as the current list/combo item
selection, or the text in a WebEdit.
11. What is GetTOProperty?
Ans: GetTOProperty returns the
value of the property from the test object's description, i.e., the value
used by QTP to identify the object. If
the property is not part of the test object's description, a warning will be
issued by QTP.
12. What is SetTOProperty?
Ans: SetTOProperty changes the
value of a test object property. Changing the property doesn't affect the OR or
Active Screen, but just the way QTP identifies the object during runtime.
13. Difference between GetROProperty and GetTOProperty
Ans:
GetToProperty: returns the specific property value from the test object properties descriptions.
GetRoProperty: returns the current property value of the object during the test run.
14. Will SetTOProperty permanently change the object properties?
Ans: No
15. What is Environment Variable? When and why is it used…explain
with example
Ans: Environment variables in QTP are like global variables in other
programming languages which can be
accessed through any part of the script. The values of these variables remains
same irrespective of the number of iterations (unless you change them through
scripting). These variables can prove to be very useful when you want a
variable to be shared across various reusable actions.
16. Types of Environment Variables
Ans: 1. Built-in
2.
User defined
17. What is parameterization? What are the different ways of
Parameterization?
Ans:
The objective of
parameterization is executing the scripts with different sets of data.
Parameterization can be possible in the fallowing ways
1: Action or test or component parameters
2: Environment Variables
3: DataTable
4: Random numbers
18. Difference between function and procedure
Ans: Functions can accept parameters and return a value where as a procedure is a named block of code which accept Parameters
and do not return any values.
19. What is instr function?
Ans: The InStr function returns the position of
the first occurrence of one string.
20. What is strcomp function? What is the value returned from the
function?
Ans: The strcmp () function shall compare the string
pointed to by s1 to the string pointed to by s2.
It returns 0 if
equal each other and a nonzero value that indicates which string is greater.
21. What is trim function?
Ans: The Trim function removes spaces on both
sides of a string. Tip: Also look at the
LTrim and the RTrim functions
22. What is MID function?
Ans: The MID () function is used to extract characters
from a string.
23. What is an array?
Ans: An array is a consecutive
group of memory locations that all have the same name and the same type. To refer to a
particular location or element in the array, we specify the array name and the
array element position number
25. What is a sub-routine? Example of sub-routine
Ans: Set of instructions, given a particular name, that will be
executed when the main
program calls for it.
A subroutine performs an action,
but doesn't return a value.
Example:
To click a button
26. What is the difference between function and sub-routine?
Ans: A function returns a value whereas a subroutine
does not return value.
29. Elaborate on the types of frameworks
Ans:
- MODULAR TESTING
FRAMEWORK
Ø A modular Testing Framework involves creation of small, independent
scripts that represent the modules, sections and functions of the
application--under--test (AUT).
2.
KEYWORD-DRIVEN TESTING FRAMEWORK
Ø This framework requires the development of data tables and keywords,
independent of the test automation tool used to execute them and the automation
script that "drives" the application-under-test (AUT) and the data.
3.
DATA-DRIVEN TESTING FRAMEWORK
Ø Data Driven Testing Framework allows large number of tests to be
executed quickly using the automation scripts instead of creating large number
of scripts for testing individual test conditions where input and output values
are read from data files and loaded into variables in the manually coded
scripts.
4.
HYBRID TESTING FRAMEWORK
Ø Hybrid Framework combines the best of Keyword Driven and Data Driven
frameworks.
30. What are Active X Objects?
Ans: An ActiveX object is an
instance of a class that exposes properties, methods, and
Events to ActiveX clients. ActiveX objects support the COM. An ActiveX
component
is
an application or library that is capable of creating one or more ActiveX
objects.
31. How to handle the exceptions using recovery scenario manager?
Ans:
1. Go to TOOLS -> Recovery scenario
manager.
2. Select the trigger event that caused
the error (it may be a pop up window).
3. Identify the name of the window with the help of POINTING HAND.
4. Choose the operation type: KEYBOARD OR MOUSE OPERATION.
5. Select the action with the help of POINTING HAND. (E.g. Click on OK button
to close the window.)
6. If you want to add another action then keep "Add another recovery
scenario" check box selected else de select it.
7. In the "Post recovery test run option" select "Proceed to
next test iteration"
8. Give scenario name & description & click on finish button.
9. Save the scenario.
10. Go to TEST->SETTINGS->SCENARIO TAB....and add the saved scenario.
11. Click on APPLY & OK button
32. What is the use of Text output value in QTP?
Ans:
Output values enable to view the values that the application talks
during run
time.When paramaterised, 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.
33. How to use Object spy in QTP?
Ans: Object spy will be used to
recognize and read all the objects on the application.
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) Thru 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 in to 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.
34. What is keyword view and Expert view in QTP?
Ans: QuickTest’s Keyword Driven approach test
automation experts
have full access to the
underlying test and object properties via an
integrated scripting and
debugging environment that is round-trip
synchronized with the
Keyword View.
Testers can view and edit their tests in the
Expert View
which reveals the underlying industry-standard
VBScript that
QuickTest Professional automatically
generates. Any changes
made in the Expert View are automatically
synchronized with the
Keyword View.
35. Explain the testing process in QTP
Ans:
The QuickTest testing process consists of 6
main phases:
Create your test plan
Prior to automating there should be a detailed description of the test
including the exact steps to follow data to be input and all items to be
verified by the test. The verification information should include both data
validations and existence or state verifications of objects in the application.
Recording a session on your
application
As you navigate through your application QuickTest graphically displays each
step you perform in the form of a collapsible icon-based test tree. A step is
any user action that causes or makes a change in your site such as clicking a
link or image or entering data in a form.
Enhancing your test
Inserting checkpoints into your test lets you search for a specific value of a
page object or text string which helps you identify whether or not your
application is functioning correctly.
NOTE: Checkpoints can be added to a test as you record it or after the fact via
the Active Screen. It is much easier and faster to add the checkpoints during
the recording process.
Broadening the scope of your test by replacing fixed values with parameters
lets you check how your application performs the same operations with multiple
sets of data.
Adding logic and conditional statements to your test enables you to add
sophisticated checks to your test.
Debugging your test
If changes were made to the script you need to debug it to check that it
operates smoothly and without interruption.
Running your test on a new version of your application
You run a test to check the behavior of your application. While running
QuickTest connects to your application and performs each step in your test.
Analyzing the test results
You examine the test results to pinpoint defects in your application.
Reporting defects
As you encounter failures in the application when analyzing test results you
will create defect reports in Defect Reporting Tool.
36. How does QTP recognize Objects in AUT?
Ans:
QuickTest stores the definitions for
application objects in a file called the Object Repository. As you record your test
QuickTest will add an entry for each item you interact with. Each Object
Repository entry will be identified by a logical name (determined automatically
by QuickTest) and will contain a set of properties (type name etc) that
uniquely identify each object.
Each line in the QuickTest 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.
37. When will you use shared and local object repository?
Ans:
The object repository per-action mode is the default setting. In this
mode QuickTest automatically creates an object repository file for each action
in your test so that you can create and run tests without creating choosing or
modifying object repository files. However if you do modify values in an action
object repository your changes do not have any effect on other actions.
Therefore if the same test object exists in more than one action and you modify
an object's property values in one action you may need to make the same change
in every action (and any test) containing the object
38. What datatable functions do
you know?
Ans:
Different data table methods are:
1) AddSheet Method
2) DeleteSheet Method
3) Export Method
4) ExportSheet Method
5) GetCurrentRow Method
6) GetRowCount Method
7) GetSheet Method
8) GetSheetCount Method
9) Import Method
10) SetCurrentRow Method
11) SetNextRow Method
39. How do you find the length of the string?
Ans:
Steps to find number of
Characters in a string:
1. Use Len
() function of VBScript to calculate length of a string, it means number of
characters
in string.
2. Pass
the given string in this function and it will return the char count.
40. How do you convert string to upper case?
Ans: Use the UCase function and to convert a string to upper-case.
41. How do you declare an array?
Ans: Example - Dim myarray(30)
42. How do you access element of an array?
Ans: The first element in an array always has the index 0,
and if the array has n
elements the last element will have the index n-1
.
Example: Myarray [1]
43. What are the two ways to initialize an array?
Ans: There are two ways of initializing the
arrays: to declare and initialize them in
one statement, or to declare an array and choose to initialize it later.
44. How do you load an excel sheet into QTP?
Ans:
DataTable.ImportSheet
"location of .xls file","sheet in .xls file","sheet in
data table"
45. What tables are used for
data-driven test cases in QTP?
Ans: Global
Sheet and Local Sheet
46. Give reasons to use
breakpoint?
Ans: Breakpoints instruct
QUICKTEST to pause a run session at
predetermined
place in a test or function library and QTP
pauses the run (at breakpoint) before executing the step.
47. In how many ways can an
application be launched?
Ans: Application can be invoked in 3
ways:
i.
SystemUtil.Run
ii.
InvokeApplication
iii.
VBscript to invoke application
48. What are regular expressions?
Ans:
A regular expression is a string that
describes or matches a set of strings.
It is often called a pattern as it describes set of strings.
Example:
- A backslash (\) instructs
QuickTest to treat the next character as a literal character, if it is
otherwise a special character.
- ^ - Matches the beginning of
input.
- $ - Matches the end of
input.
- * - Matches the preceding
character zero or more times.
- . - Matches any single character
except a newline character.
49. Different Stages in BPT
Ans: Components Identification,
Component Automation, Business Process Test Case, Business Process Test
Sets
50. What
are the properties you would use for identifying a browser & page when
using descriptive programming?
Ans: “name” would be another property apart
from “title” that we can use. OR We can
also use the property “micClass”.
Ex: Browser(”micClass:=browser”).page
(”micClass:=page”)….
51. How to write Descriptive Programming?
Ans: There are
two ways in which descriptive programming can be used
1. By giving the description in form of the string arguments.
2. By creating properties collection object for the description.
52. How to get the no. of description defined in a
collection
A: Ex:
obj_ChkDesc.Count ‘Will return 2 in our case
53. How to remove a description from the collection
A: obj_ChkDesc.remove
“html tag” ‘would delete the html tag property from the collection
54. How do I check if property exists or not in the collection?
A: The answer is that it’s not possible. Because
whenever we try to access a property which is not defined its automatically
added to the collection. The only way to determine is to check its value that
is use a if statement “if obj_ChkDesc(“html tag”).value = empty then …”.
55. Commonly used active x controls in QTP
Ans:
AcxTable controls
AcxRadioButton
AcxEdit
AcxComboBox
AcxCheckBox
AcxCalender