You are on page 1of 43

1) Full form of QTP?

Ans:-Quick Test Professional

2) What is QTP?
Ans: - It is a record and play back and graphical user interface functional testing tool.

3) Which scripting language used by QTP?


Ans:-QTP uses VB & Java scripting.

4) What are the types of Views?


Ans: The two types of views are 1. Keyword view, 2. Expert view

5) What's the basic concept of QTP?


Ans: - QTP is based on two concept-
* Recording
* Playback
6) How many types of recording facility are available in QTP?
Ans:-QTP provides three types of recording methods-
* Context Recording (Normal)
* Analog Recording
* Low Level Recording

7) Differences B/W Normal, Analog and Low Level Recording?


Ans:-
Sl.no Normal recording Analog recording Low recording
1 It is not a co-ordinate It is a coordinated It is a coordinated
dependent dependent dependent
2 The statement generated The statement generated The statement
are editable are non editable generated are non
editable
3 Records exactly based on Records exactly on the Records exactly on
the standard objects basis of mouse and the basis of
keyboard movement keyboard movement
4 It is partially dependent on It is completely It does not depends
object repository dependent on object upon the object
repo. repo.
5. It record object in the It records the object in It records objects
presence of Add-ins. the presence of add-ins. even in the absence
of add-ins.
6 It records the parent object It records the parent It records parent
as a parent object and child object as a parent object object as window
object as child objects and and child object as child and child object as
records actions are object and recorded win object and
performed on object. actions are performed performs limited
on object . actions.
8) What is add-ins?
Ans: - It is a supporting software help to QTP to identify the GUI objects (Property
objects, property values) to the Specific environment.

9) What is default add-ins in QTP?


Ans: - WEB, VISUAL BASIC and ACTIVEX.

10) Name the Environments supported by QTP?


Ans:-
ERP/ CRM
Java/ J2EE
VB, .NET
Multimedia, XML
Web Objects, ActiveX controls
SAP, Oracle, Siebel, PeopleSoft
Web Services, Terminal Emulator
Browsers:- IE, NN, AOL, Mozilla fire fox.

11) How can you view the Test Tree?


Ans:-The Test Tree is displayed through Tree View tab in(keyword view).

12) What's the Expert View?


Ans: - Expert View displays the Test Script.

13) Short cut Keys in QTP


Nornamal Recording: F3
Analog Recording: Alt+Shift+F3
Low Level Recording: Ctrl+Shift+F3
For stop the recording: F4
Run the test script: F5
Run from step: Ctrl+F5
Switch between Tree View and Expert View: Ctrl+Tab
Step Into: F11
Step Over: F10
Step Out: Shift+F11
Run to step: Ctrl+F10
Insert/Remove Break point: F9
Enable/Disable Breakpoint: Ctrl+F9

14) What is Check Points?


Ans: - Check point is a feature available in QTP it helps us to compare Expected Value
against the Actual Value.
Expected Value: User Defined
Actual Value: Taken by Run Time Application
15) What are the Different Types of Check Points?
Ans:-
Standard Check Point
Text Check Point
Text area Check Point
Bit Map check Point
Database Check Point
XML Check Point (From Resources)
Accessibility Check Point

16) Definitions of Check Points.


Ans:-
Standard Check Point: It helps us to verify the Standard property of the specified object.
Text Check Point: Verify the text present on the specified object.
Image Check point:- Image Checkpoints enables us to check the properties of Web page
Bitmap Check Point:-

17) What is a Text Checkpoint?


Ans: - Text Checkpoints enables us to check that the Text is displayed in a Screen
, Window or Web Page. Text Checkpoint is supported for all environments.

18) What is a Text Area Checkpoint?


Ans: - Text Area Checkpoints enables you to check that a text string appears within a
Defined area in a Windows application, according to specified criteria.
Text Checkpoints can be inserted during recording only.
Text Area Checkpoints are not supported by Web Applications.

19) How the Text Checkpoints can be created?


Ans: - 1. Display the page, window or screen containing the text we want to check.
2. Select INSERT  CHECKPOINT  TEXT CHECKPOINT. The QTP
Window is minimized and the mouse pointer becomes pointing hand.
Click the text string for which we want to insert Text Checkpoint.
The Object Selection dialog box appears. Select the object which we want and click OK
button.
The Text Checkpoint Properties dialog box opens.
Specify the Text checkpoint settings.
Click OK button. The Checkpoint step will appears in the Keyword view and Expert
view.

20) How to add Text Checkpoint while editing?


Ans:- 1. Go to the Active screen in the Keyword view.
2. Right-Click on the object for which we want to insert the Text Checkpoint. A set
of checkpoints will be available. From that select Text Checkpoint.
An Object selection window will appear. Select the object which we want and click OK
button.
The Text Checkpoint Properties box appears .
Click OK button . A Text Checkpoint statement will be added in both Keyword view and
in the Expert view.

21). How can we create a Text Area Check points?


Ans:- 1. Select INSERT  CHECKPOINT  TEXTAREA CHECKPOINT.
The QTP window is minimized and the mouse pointer becomes
Crosshair pointer.
2. Select the area u want to check by clicking and Dragging the Crosshair pointer.
3. The Object Selection Dialog box appears. Click OK button.
The Checkpoint properties dialog box appears.
4. Specify the settings and Click OK button. The Checkpoint step is added in both
the Keyword view and the Expert view

22) What is the purpose of the Database Checkpoints?


Ans: - Database Checkpoints are used to check the database accessed by our web or
Application and to detect defects.
We define the query in the on our Database and then we will create a
Database checkpoint to check the result of the query.
Database Checkpoints are supported by all the add-ins which are there
in the QTP.
23) In how many ways we can define a database query?
Ans: - In 2 ways we can define a Database query:-
1. Using Microsoft query.
2. Manually define a sql statement.
-
24) What is output value?
Ans:- An output value is a step in which one or more values are captured at a specific
point in your test or component and stored for the duration of the run session. The
captured value is displayed in the result sheet in the runtime data table.

25) What is difference between the checkpoints and output value?


Ans:-
Sl.no Checkpoints Output value
1. It has 8 checkpoints It has 6 output values.
2. It is used to verify the It is used to get the value of the
actual value with specific objects property and its
excepted value of the value during runtime
specific objects property
and its value
3. It is used in the recording It is used in the recording mode
mode only only
4. The result of the The result of the out put value is
checkpoints in not stored stored in the runtime data
in the run time data table table in the result file
26) What is active screen?
Ans:- Active screen is a feature which captures snapshots of the action performed on the
application during recording .

27) What are the advantages of the active screen?


Ans:-
Sl.no Advantages of the Active screen
1. It is used to know the status of an
application
2. It is used to put check points
3. It is used to put output value
4. It is used to put the objects in the
object repository.

28) What is an action?


Ans: - It is a process of groping logical related set of statements. Dividing lengthy script
in to small component based on functionality
OR
Action is a feature in QTP which is used to group the logically related set of statements
into single entity.

29) How many types of Actions are there?


Ans: - there are three types of Actions
a. Reusable actions
B.Non-reusables actions
c. External Actions

30) What is the difference between Non-Reusable, Reusable, And External Actions?
Ans: - Non-Reusable Actions:- An action that can be called with in the test where it is
stored, and can be called only once.
Reusable Actions:- An actions that can be called from the test where it is stored
and also from other tests. We can call these actions multiple times.
External Actions:- External Actions are reusable actions stored with another test.

31) In how many ways the created reusable actions are called into a “Main Calling”
test?
Ans: - There are 3 ways to call the created reusable actions into the Main Calling test:-
 Call to New Action.
 Call to Copy of Action
 Call to Existing Action.
32) How we can set Actions as Reusable Actions?
Ans:- 1. Right Click on the Action which u want to make it as Reusable.
2. from that select Action Properties and a Action Properties Window appears.
3. If we want to change the name of the Action we can change it by entering our
Own Action name in the NAME textbox.
4. Check the Checkbox beside to the text named “Reusable Action” and click OK
Button.
33) How can we create a New Action?
Ans: - 1. While recording or editing choose INSERT  Call to New Action or click the
Insert Call To New Action Button.
The Insert Call to New Action Dialog box appears.
2. Type new Action name or if we want to add default name just accept it.
3. If we want to add the description for the Action we can give in the Description
Textbox.
If we want to make the action as the Reusable action the check the Reusable
Action Checkbox.
Decide weather to insert the new action at the End of the test or After the
urrent step.
Click Ok.

35) What do u meant by Nesting Of Actions?


Ans: - Calling an Action with in an action is called Nesting Of Actions.

36) How can we Split an action?


Ans: - We can split an action that is stored in the test into 2 sibling actions or a Parent-
Child actions.
To split an action:-
Select the step before which we want the new action to begin.
Choose Step  Split Action or right click the step and select Action  Split Action. The
Split Action Dialog Box opens.
Choose one of the following Actions.
 Independent of each other:- Splits the selected actions into 2 sibling
actions.
 Nested:- Splits the selected action into Parent-child actions.
If we want to change the Name and Description of 2 actions we can change.
Click OK button.

37) What is an object repository?


Ans:- Object Repository is a container which contains a objects property and property
value.

38) What are types of object repositories?


Ans:- there are two types of Object repositories:-
Per-Action
Shared Action

39) What is Per-Action Object Repository?


Ans:- In Per-Action Object Repository the property and property value of an object is
used with in the test script
40) What is shared Action Object repository?
Ans:- In shared -Action Object Repository the Property and property value of an object
is used to another test scripts

41) How do QTP identifies the objects property and property value?
Ans: QTP identifies the objects property and property value by its Logical name.

42) Where does the Object Repository is located?


Ans: - The object Repository is located in Resources option.
Resources -- Object Repository

43) Why Regular Expressions are used?


Ans: - Regular Expressions are used to allow for any value generated by the application
for the property you specify.

44) How we can add a RE in our application?


Ans: - 1. Go to CHECKPOINT PROPERTIES window and make sure that Constant is
enabled and click on the note paper icon.
2. Enter the RE u want to enter in the VALUE text box and check the RE
Checkbox.
3.If QTP sees there are characters that can be misconstrued as a RE , it will ask
you to treat it as a literal character. Generally, we will answer NO.

45) What are the RE available in QTP?


Ans:-
. Matches any single character.
* Matches zero to any number of occurrences of the preceding
Character.
+ Matches one to any number of occurrences of the preceding
Character.
[A-Z][a-z] Matches a range of characters.
[0-9] Matches a range of digit.
\d Matches any digit.
\d{4} Matches exactly four digits.

46) How we can add a comment field?


Ans: - If we Right-Click on the header field of the Keyword view and it shows a list of
fields with check mark next to them. And we can add comment field from here.

47) What are Parameters?


Ans: - Parameterization is a process of replacing constant with a parameter.
Constant- Hardcode value
Parameter- It is a variable which gets the data from external source.
OR
Parameter is a variable that is assigned a value from the external data source.
48) What does u mean by parameter zing a test?
Ans: - Parameterizing a test is to check how the application performs the same operation
With different data.

49) What are the Data Table parameters available in QTP?


Ans: - The Data Table Parameters available in QTP are:-
Input parameter:- Using Input Parameter we can run the test using different sets of data
input values.
Output Parameter: - Using Output parameter we can use output to capture values from the
application during runtime.

50) What are Random Number parameters?


Ans: - Random Number parameters are the system-generated numbers inserted into the
Parameter field during a test run.

51) What are Environment variables?


Ans: - Environment variables are the variables describing the Software or Hardware
Object in the AUT environment.
Ex: - The OS version of the local host name.

52) How we can create an Input Parameter and set the parameter value?
Ans: - To create an input data table parameters:-
Select the step in the Keyword view thet contains recorded input values.
From Value column click on the current value.
Click on the parameter button.
The Constant value appears in the Value Configuration Options dialog box.
In the Name drop down list, enter an column name to create new column in the data table
or choose an existing column name from the data table.
Use the Default Global data sheet to store values.
7. Click OK button.

53) What are Output Parameters?


Ans:- An Output parameter is a value which comes back from the application under test.
When we run the test, Qt will retrieves current value of the property and enters it
in the run-time Data Table as an output value.

54) What is meant by data correlation?


Ans: - Using output value as an input variable in the test is known as Data Correlation.

55) How we can create an Output parameter?


Ans: - 1. In the Keyword view, choose a step that contains the field whose value will be
Output.
2. In the Active Screen, right-click on the field whose value we want to output.
3. Choose Insert Output Value from the list.
4. An Object Selection window appears click OK button.
5. An Output value properties window appears.
6. Check only the objects u wants to parameterize.
7. If we want to modify the column name click on Modify button and change the
Name to be used in the Global data sheet.
8. Decide whether the output should be placed Before Current Step or After the
Current Step.
9. Click OK button.

56) What is the default range of the Random Numbers?


Ans: - The default ranges of the random numbers are between 0-100. We can also change
The settings in the Parameter Options dialog box.

57) What are the Types Of The Environment Variables available in Qtp?
OR

Ans: - There are 3 Environment variables available:-


1.User-Defined Internal.
2.User-Defined External.
3.Built-In.

58) What is “sync ()”?


Ans:- Sync () is a method used to make the tool to wait until all the objects in the AUT
. Load or display

59) What is wait () and Exist ()?


Ans:- the Wait () and Exist (): This statement to instruct QTP to wait fro a window to
Open or an object to appear.
Exist (): it return a Boolean value indicating weather OR not object currently.
Wait (): this instructs QTP to wait a specific amount to time before proceeding to
the next step.

60) What is an object?


Ans: - An object is blueprint of a class.

61) What is class mapping?


Ans: - It is a process of converting the non –Standard objects to standard objects.

62) What is Virtual objects?


Ans: - Mapping standard objects to another standard object.

63) What is Object Spy?


Ans: - Object Spy is a container which as a objects property and property value of a
particular object.

64) What are the 2 types of the Datasheets available?


Ans: - The 2 types of the Datasheets available are:-
1) Global Datasheet. 2) Action Datasheet.
65) What is the difference between Global Datasheet and Action Datasheet?
Ans:- If we store the data in Global Datasheet that data will be available to all the actions
in that test.
It is used to control the test iterations.
If we store the data in the Action Datasheet that data will be available to only that
Particular action.
This is used to control the action iterations.

66) What are the various Data table menu commands available?
Ans:- The various Data table menu commands available are:-
File.
Sheet.
Edit.
Data.
Format.

67) What are the different types of commands available in the File menu?
Ans:- 1. Import from the file:- Imports an existing Ms excel sheet or a text file into the
data table.
2. Exports :- Exports the datatable to a specified Ms excel sheet.
3. Print:- Prints the entire Datatable or the selected sheet.

68) What are the commands available in the Sheet menu?


Ans:- 1. Imports> From the file
2. Imports> From the Database.
3. Export.

69) What are the commands available in the Edit menu?


Ans:- 1. Cut:- Cuts the table selection and places it on the Clipboard.
2. Copy.:- Copies the table selection and places it on the Clipboard.
3. paste.:- Pastes the contents of the Clipboard to the current table selection.
4. Paste values:- Pastes values from the Clipboard to the current table selection.
5. Clear.:- Clears formats or contents from the current selection.
6. Insert:- Inserts empty cells at the location of the current selection.
7. Delete.:- Deletes the entire current row or column selection.
8. Fill Right.:- Copies data in the left-most cell of a selected range to all the cells to
the right of that left- most cell within the selected range.
9. Fill Down.:- Copies data in the top cell of a selected range to all cells below that
top cell within the selected range.
10. Find.:- Finds a cell containing specified text.
11. Replace.:- Finds a cell containing specified text and replaces it with different
text.
12. Goto.:- Goes to a specified cell.
70) What can an Object do?
Ans: - An Object can set a property, perform a function or both.

71) What is a Method/Function do?


Ans: - A Method/Function is an action performed on an object.

72) What is meant by a property?


Ans: - A property is an unique characteristic to identify an object.

Ex: - (object name) (object logical name)


Dialog(“Login”).Wined it(“Agent Name:”).Set “jojo”
(object) (object) (. Method or property)

73) What do u meant by Object model?


Ans: - An Object model is a structural representation of software objects(classes) that
Comprise the implementation of a system or application.
An object model defines a set of classes and interfaces, together with
Their properties, methods and events.

74) What are the capabilities of Advanced Data Table?


Ans: - We can use formulas.
E.g. Sum of 2 columns (A1 + B1)
We can use functions for String manipulations, Date/Time.
We can encrypt the data.
Export/Import data to and from external files.
Data Table scripting.

75) What are virtual objects?


Ans: - Virtual objects are the objects which are not identified as standard objects in Qtp.
We can define these objects as virtual objects and map them to standard classes as
Buttons or checkboxes.

76) How can we define the virtual objects?


Ans: - We can define the virtual objects using Virtual Object wizard. The wizard prompts
us to select the standard object class to which we want to map the virtual objects.

77) What is a Virtual object collection?


Ans: - A virtual object collection is a group of virtual objects that is stored in the Virtual
Object manager using descriptive name.

78) What is the process for Defining a Virtual object?


Ans: - We can define a Virtual object using the virtual object wizard.
Go to Tools  Virtual Objects  New Virtual Object.
From Visual Object Manager click NEW. The Virtual Object Wizard opens and click
Next.
Select a Standard class to which we want to map a Virtual Object. Click NEXT.
Click Mark Object.
The QTP window and the Virtual Object Wizard window minimizes. The mouse pointer
becomes the cross hair pointer. Use the cross hair to mark the area of the virtual object.
Click NEXT.
Click an object in the object tree to assign it as an parent of the virtual object.
In the Identify Object Using box select how we want QT to identify and map
The virtual object.
If you want Quick Test to identify all occurrences of the virtual object, select
Parent only.
If you want Quick Test to identify the virtual object in one occurrence only,
Select entire parent hierarchy.
Click NEXT.
Specify the name and the collection for the Virtual Object. Click Finish.

79) How can we disable the reorganization of Virtual objects while recording?
Ans: - 1. Choose Tools  Options or click on Options tool bar button.
2. In General Tab select Disable reorganization of Virtual Objects While
Recording.
3. Click OK.

80) What does a Action Tool bar contains?


Ans: - An Action Toolbar contains the options that enable you to view all action calls in a
Test flow or to view a details of selected actions.
By default the Action tool bar is hidden in the Keyword view
When we open the Quick Test. When we insert the reusable or external actions into
The test then the action toolbar is automatically displayed.

81) What is an Action List?


Ans: - An Action list enables us to view either the entire testflow or we can view the
steps
for the selected reusable or external actions.

82) What is a Test Flow?


Ans: - The test flow displays the overall flow of the test with all the action calls in our
Test.
83) What are the functions used to convert values from one type to other?
Ans:- TEXT ------------------ TEXT(value,format)
VALUE ------------------ VALUE (string)

84) What is Recovery Scenario?


Ans:- Recovery Scenario:- The recovery scenario manager provides us a wizard that
guides us the process of defining a recovery scenario.
A definition of unexpected events and the operations necessary to recover the run
Sessions.
85) What does a Recovery Scenario consists?
Ans: - A Recovery Scenario consists of following:-
Trigger Events:- The events that interrupt our run session.
Ex:- Popup window may appear.
Recovery Operations:- The operations that are need to be performed in
order to continue the running the test or component.
Post Recovery Operations:- The instructions on which QT should proceed
once the recovery operations has been performed.

The Recovery scenarios are saved in recovery scenario files. The Recovery Scenario files
are the logical collection of the recovery scenarios.

86) When can we use a Recovery Scenario?


Ans:- We can use the Recovery Scenarios only for the unpredictable or for the
Unexpected events only.

87) In order to control run sessions we use step commands and pause commands.

88) What is the use of Step commands? What are the Step commands available in
QTP?
Ans: - To run a single step of a test or component we use Step commands. The Step
Commands available in QTP are:-
Step Into.
Step Out.
Step Over.

89) What is the difference between Step Into, Step Out, Step Over commands?
Ans:- Step Into:- When the current step calls another action or function , the called
action or function is executed and is displayed in the Quick test
window, and the test or component pauses at the first line of called
action/function.
Step Out:- Step out runs to the end of the called action and the returns to
calling action and pauses the run session.
Step Over:- When the current step calls another action or function , the called
action or function is executed but is not displayed in the Quick test
window.

90) How can we insert a Step commands?


Ans:- Choose DEBUG  STEP INTO or STEP OUT or STEP OVER or press the Step
Into, Step Out, Step Over buttons.

91) How can we temporarily suspend the run session?


Ans:- To temporarily suspend the run session by choosing DEBUG  PAUSE or click
on the PAUSE button. The test stops running.
To resume running a paused test click the RUN button or choose Test  Run or
Component  Run.
92) How can we insert Break points?
Ans:- 1. Click the step or the line where we want to insert the break point.
2. Choose DEBUG  INSERT / REMOVE Breakpoints , press f9 or Right click on the
step where we want to insert Breakpoint and choose Insert/Remove Breakpoint.

93) What is the use of Debug Viewer?


Ans: - Debug Viewer is used to view, set and modify the current values of the
Objects or variable in the test when it stops at the Breakpoint.

94) How can we open the Debug Viewer pane?


Ans: - 1. Run a test or component with one or more breakpoints.
2 When it pauses at a breakpoint, choose View > Debug Viewer or click the
Debug Viewer button.

95) What is the purpose of the Watch Expression Tab?


Ans: - The purpose of Watch Expression tab is to view the current values of any variable
Or VbScript objects that we entered in the Watch Expression Table.
Paste or enter the name of the variable or object in the Name field to view
the value of the object.

96) What is the purpose of the variables Tab?


Ans: - Variables tab is used to view the current values of all variables in the current
action or selected subroutine up to the point where the test or component is stopped.

97) What is the purpose of the Command Tab?


Ans:- Command tab is used to execute a line of script in order to set or modify the
current values of a variable or Vbscript object in our test or component.

98) What are the tabs available in the Test Setting Dialog Box?
Ans: - The tabs available are:-
Properties:- Name, Author, Last modified using, Description, location,
Associated Add-Ins, Modify, Generate Script.

Run:- Data Table iterations(Run One iteration only, Run on all rows, Run
From row to row), When error occurs during run session(proceed to
Next action iteration, stop run, proceed to next step, popup
message Box), Object Synchronization time, Disable smart identification
During run session, save image of desktop when error occurs.
Resources:- Resource tab is used to associate some specific files with your
test such as VBScript library files and Data Table files,
and to specify the object repository mode and file to use for your
test.
Parameters:- Input Parameters, Output Parameters.
Environment:-It displays existing Built-In(Name, Description, Current value) and User-
Defined functions(Name, Value, Type{Internal or External}).
Internal Environment variables are available to only the test or component in which it is
defined.

Web.
Recovery.

99) What is the difference between Shared Object Repository mode and Per-Action
Repository mode?
Ans:- Shared Object repository we can use one object repository file for multiple tests.
The file extension for the Shared Object Repository is .tsr.
Per-Action repository for each and every test one object repository file is created.
The file extension for this mode is *.mtr.

100) in how many ways the objects are saved?


Ans:-The objects can be saved in 2 ways. They are:-
1. Shared Object repository mode.
2. Per-action repository made.

101) how can we customize the Expert view behavior?


Ans: - Choose TOOLS  Editor Options  General tab.

102) how can we customize the Script Element behavior?


Ans: - Choose TOOLS  Editor Options  Font and Colors tab.

103) How can we Personalize Editing Commands?


Ans:- Choose TOOLS  Editor Options  Key Binding.

104) what is the use of SetToProperty method?


Ans: - SetToProperty method is used to modify the test object properties during run
Session, with out changing the property values in the object repository.
105) file Extensions in Qtp?
Ans:-
Test Scripts : .mts
VB : vbs
Startup Scripts: .vbs
Per-Action : .mts
Shared-Action: tsr
Batch Script : .mts

106) what are advantages of Automation?


Ans:- the advantages of automation are
Execution speed is more
More Accurate
Improve in the coverage
Improve the Reliability of testing
High return of investment
Less redundancy

107) what are the QTP Challenges?


Ans: -
1) Unable to understand custom object, then we have to map
That objects to standard object.
2) To handle the runtime objects.
3) Using Regular Expressions.
4) Main problem is with Synchronization.
5) While testing Web-based application, people might face
Object recognition problem. At this situation, one can use
Smart Identifier. Once it is used in the script and run it,
in the result window, they can find out which are the
Properties to uniquely identify specified record. After
Those without using smart idenfier one can execute script.
6) One of the challenges user face with QTP web based
An application is 'Working with Dynamic Objects'. If we have
Dynamic objects on screen which can be part of a table or
Otherwise as well. Descriptive programming is the only way
To work with these kind of objects in QTP.

107) what is Descriptive Programming?

QTP can perform some action on objects at run time only when it is able to uniquely
identify the object. In order to identify the object at run time (play back), QTP learns
some physical properties of the object at the time of recording and stores them in object
Repository (OR). When QTP runs the script, it compares these properties and values to
the actual objects appearing in the application, and performs the action on the object if it
finds it.

Thus, it is not possible for QTP to perform action on objects during run time if the objects
are not there in OR. But descriptive programming provides a way to perform action on
objects which are not in Object repository. We can instruct QTP to perform methods on
the objects that are not there in object repository with the help of programmatic
description or descriptive programming.

108) When and Why to use Descriptive programming?

When using Descriptive Programming (DP), we’re bypassing the native object repository
(OR) mechanism which may have many advantages. Let’s examine the situations in
which the OR’s advantages are outweighed by the DP.

Suppose we are testing the site that displays the list of users whose details matches with
the search criteria that is entered in search text field. With the names, the application also
displays checkboxes against each name. Now, we want to test the scenario where
application sends mail to all the users whose names are displayed in the list. But we are
not sure how many check boxes will be displayed on the page as the search criteria can
differ . In this situation, you can use a programmatic description to instruct QuickTest to
perform a Set “ON” method for all objects that fit the description: HTML TAG = input,
TYPE = check box

The other usage of DP can be as follows:

1) Programmatic descriptions can be used to perform the same operation on several


objects with certain identical properties, or to perform an operation on an object whose
properties match a description that is determined dynamically during the run session.

2) One place where DP can be of significant importance is when you are creating
functions in an external file. You can use these function in various actions directly,
eliminating the need of adding object(s) in object repository for each action [If you are
using local object repository]
3) The objects in the application are dynamic in nature and need special handling to
identify the object. The best example would be of clicking a link which changes
according to the user of the application, Ex. “Logout ”.

4) When object repository is getting huge due to the no. of objects being added. If the
size of Object repository increases too much then it decreases the performance of QTP
while recognizing a object.

5) When you don’t want to use object repository at all. Consider the following scenario
which would help understand why not Object repository

Scenario 1: Suppose we have a web application that has not been developed yet.Now
QTP for recording the script and adding the objects to repository needs the application to
be up, that would mean waiting for the application to be deployed before we can start of
with making QTP scripts. But if we know the descriptions of the objects that will be
created then we can still start off with the script writing for testing

Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let
the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons
would add 3 objects per page in the repository. For a 10 page flow this would mean 30
objects which could have been represented just by using 3 objects. So instead of adding
these 30 objects to the repository we can just write 3 descriptions for the object and use it
on any page.

6) When you want to take action on similar type of object i.e. suppose we have 20
textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now
adding all 20 the Object repository would not be a good programming approach.
109) Advantages of Descriptive Programming:

1)Basically by having object repository it has both advantages as well disadvantages. We


all know about
Advantages.. As far as disadvantage is concern Suppose if u have unstable application ie
Properties might change or Name of the Object might change. Frequent changes are
happening in ur application. We will go for descriptive programming.. Objects id will be
unique for all applications.. So by having unique id we can write the code like
2) This will be clarified via an example: we’re dealing with an unknown number of
checkboxes. We don’t know (and don’t care) how they’re called, or where they are on the
screen – we just need to mark all of them as checked. If we were to do this "the old way",
we would have to keep track of each checkbox’s properties, and write separate
commands that identify each of them, and marks them. With the new objects-collection
method, we can ask for all the checkboxes in the screen, loop through them, and mark all
of them with a single, easily maintainable command.

110) Object Repository:

Advantages of Shared Object Repository –

(1) uses the existing information and does not add the object to the object repository if
you record operations on an object that already exists in the shared object repository
(2) easily maintain your tests or components when an object in your application changes
(3) manage all the objects for a suite of tests or components in one central location
(4) Renaming the object name is time consuming. As If you rename objects in a shared
object repository in one test or component and save the changes, when you open another
test or component using the same shared object repository, that test or component updates
the object name in all steps of the test or component. This process may take a few
moments. If you save the changes to the second test or component, the renamed steps are
saved.

Disadvantages of Shared Object Repository -

(1) If you add an existing shared object repository file from the file system to a Quality
Center project, it will be a copy of the one used by tests not in the Quality Center project.
(2) You must be connected to Quality Center to work with a shared object repository in
the file system.
(3) Once you save the file to the project, changes made to the Quality Center repository
file will not affect the file in the file system and vice versa.

Advantages of per-test Object Repository –


As you record operations on objects in your application, QuickTest automatically stores
the information about those objects in the appropriate action object repository.
(2) When you save your test, all of the action object repositories are automatically saved
with the test as part of each action within the test. The action object repository is not
accessible as a separate file (as is the shared object repository).

Disadvantages of per-test Object Repository –


Modifying the test object properties, values, or names in one object repository does not
affect the information stored for the same test object in another object repository or in
other tests - Time Consuming
(2) If you add objects to one of the split actions, the new objects are added only to the
corresponding action object repository.

111) what is Automation Framework and what are the types of Automation
framework explain?
Ans:-
Automation framework is a process followed by different companies based on there
requirement to execute the test scripts successfully with out any manual interruption.
OR
Automation framework is collection of generic scripts, project specific scripts and some
other associated scripts.

Different types of framework:

1. Test Script Modularity


2. Test Library Architecture
3. Data-Driven Testing
4. Keyword-Driven or Table-Driven Testing
5. Hybrid Test Automation

Data-Driven Testing
A data-driven framework is where test input and output values are read from data files
(ODBC sources, CVS files, Excel files, DAO objects, ADO objects, and such) and are
loaded into variables in captured or manually coded scripts. In this framework, variables
are used for both input values and output verification values. Navigation through the
program, reading of the data files, and logging of test status and information are all coded
in the test script. This is similar to table-driven testing (which is discussed shortly) in that
the test case is contained in the data file and not in the script; the script is just a "driver,"
or delivery mechanism, for the data. In data-driven testing, only test data is contained in
the data files.
Merits of data-driven testing
The merits of the Data-Driven test automation framework are as follows,
Scripts may be developed while application development is still in progress
Utilizing a modular design, and using files or records to both input and verify data,
reduces redundancy and duplication of effort in creating automated test scripts
If functionality changes, only the specific "Business Function" script needs to be updated
Data input/output and expected results are stored as easily maintainable text records.
Functions return "TRUE" or "FALSE" values to the calling script, rather than aborting,
allowing for more effective error handling, and increasing the robustness of the test
scripts. This, along with a well-designed "recovery" routine, enables "unattended"
execution of test scripts.
Demerits of data-driven testing
The demerits of the Data-Driven test automation framework are as follows,
Requires proficiency in the Scripting language used by the tool (technical personnel)
Multiple data-files are required for each Test Case. There may be any number of data-
inputs and verifications required, depending on how many different screens are accessed.
This usually requires data-files to be kept in separate directories by Test Case
Tester must not only maintain the Detail Test Plan with specific data, but must also re-
enter this data in the various required data-files
If a simple "text editor" such as Notepad is used to create and maintain the data-files,
careful attention must be paid to the format required by the scripts/functions that process
the files, or script-processing errors will occur due to data-file format and/or content
being incorrect

Keyword-Driven Testing
This requires the development of data tables and keywords, independent of the test
automation tool used to execute them and the test script code that "drives" the
application-under-test and the data. Keyword-driven tests look very similar to manual test
cases. In a keyword-driven test, the functionality of the application-under-test is
documented in a table as well as in step-by-step instructions for each test. In this method,
the entire process is data-driven, including functionality.

Example
In order to open a window, the following table is devised, and it can be used for any other
application, just it requires just changing the window name.

Test Table for Opening a Window


Window Control Action Arguments

Window Name Menu Click File, Open

Window Name Menu Click Close

Window Name Pushbutton Click Folder Name

Window Name Verify Results

Once creating the test tables, a driver script or a set of scripts is written that reads in each
step executes the step based on the keyword contained the Action field, performs error
checking, and logs any relevant information.

Merits of keyword driven testing


The merits of the Keyword Driven Testing are as follows,
The Detail Test Plan can be written in Spreadsheet format containing all input and
verification data.
If "utility" scripts can be created by someone proficient in the automated tool’s Scripting
language prior to the Detail Test Plan being written, then the tester can use the
Automated Test Tool immediately via the "spreadsheet-input" method, without needing
to learn the Scripting language.
The tester need only learn the "Key Words" required, and the specific format to use
within the Test Plan. This allows the tester to be productive with the test tool very
quickly, and allows more extensive training in the test tool to be scheduled at a more
convenient time.

Demerits of keyword driven testing


The demerits of the Keyword Driven Testing are as follows,
Development of "customized" (Application-Specific) Functions and Utilities requires
proficiency in the tool’s Scripting language. (Note that this is also true for any method)
If application requires more than a few "customized" Utilities, this will require the tester
to learn a number of "Key Words" and special formats. This can be time-consuming, and
may have an initial impact on Test Plan Development. Once the testers get used to this,
however, the time required to produce a test case is greatly improved.

Hybrid Test Automation Framework


The most commonly implemented framework is a combination of all of the above
techniques, pulling from their strengths and trying to mitigate their weaknesses. This
hybrid test automation framework is what most frameworks evolve into over time and
multiple projects. The most successful automation frameworks generally accommodate
both Keyword-Driven testing as well as Data-Driven scripts.
This allows data driven scripts to take advantage of the powerful libraries and utilities
that usually accompany a keyword driven architecture. The framework utilities can make
the data driven scripts more compact and less prone to failure than they otherwise would
have been.
The utilities can also facilitate the gradual and manageable conversion of existing scripts
to keyword driven equivalents when and where that appears desirable. On the other hand,
the framework can use scripts to perform some tasks that might be too difficult to re-
implement in a pure keyword driven approach, or where the keyword driven capabilities
are not yet in place. The following sections describe its architecture, merits and demerits.
Our test automation framework is a
Hybrid Test Automation Framework

Hybrid Test Automation Framework Architecture


The framework is defined by the Core Data Driven Engine, the Component Functions,
and the Support Libraries. While the Support Libraries provide generic routines useful
even outside the context of a keyword driven framework, the core engine and component
functions are highly dependent on the existence of all three elements.
The test execution starts with the LAUNCH TEST(1) script. This script invokes the Core
Data Driven Engine by providing one or more High-Level Test Tables to CycleDriver(2).
CycleDriver processes these test tables invoking the SuiteDriver(3) for each
Intermediate-Level Test Table it encounters. SuiteDriver processes these intermediate-
level tables invoking StepDriver(4) for each Low-Level Test Table it encounters. As
StepDriver processes these low-level tables it attempts to keep the application in synch
with the test. When StepDriver encounters a low-level command for a specific
component, it determines what Type of component is involved and invokes the
corresponding Component Function(5) module to handle the task.

All The Application Map is referred to App Map. This App Map in WRAFS
of is the Application Map file created from GUI Map of WinRunner
these
elements of the framework rely on the information provided in the App Map to interface
or bridge the automation framework with the application being tested. The App Map is
the only means by which the framework could identify the objects in the application
under test. Each of these elements is described in more detail in the following sections.
The following figure shows the diagrammatic representation of the Hybrid Test
Automation Framework.

Hybrid Test Automation Framework


QTP Answer Sheet

1. Which Statement is used to explicitly declare a variable?


Ans: - Dim

2. Which Method we use to find the current row of the sheet


Ans: - GetCurrentRow Method

3. If you are outputting the value from an application during run time. Where it is placed
Ans: - Run-Time Data table in Test Result

4. When you want to iterate one action in a test that has multiple actions, where do you
place the data?
Ans: - Action Tab, Corresponding to that Action

5. Which Quick Test function can you use to get the row count of imported data?
Ans: - GetRowCount

6. Which Quick Test function would you use to import a file into the data table, write the
syntax of the statement.
Ans: - Import.file path

7. Which Quick Test features did you use to view the pre-defined set of properties used to
identify the Object
Ans: - Object Identification

8. Types of Ordinal Identifier


Ans: - Index & location

9. What are the three ways you can create a text file using the FSO?
Ans: - Create Text File, Open Text File, Open Text as Stream

10. What are the two major categories of FSO file manipulation?
Ans: - (1). Creating, Adding, removing and Reading the data
(2). Moving, Copying and deleting the data

11. What is Create Object Method?


Ans: - To Create a FSO object

12. When would you use the Object Spy?


Ans: - To View the properties
13. What is Method used to Retrieve the current value of a test object property from a
run- time object in your application.
Ans: - GetRoProperty

14. How do you associate a function in a library to a test in QTP?


Ans: - Save the file as .vbs and Go to Test->Settings->Resources

15. When would you use the Extern object to declare a function in Quick Test?
Ans: - To access the Window API function

16. What is the default time in Quick test waits for a step to process
Ans: - 20 seconds

17. What does the meaning of “\d” & “\d {4}” regular expressions?
Ans: - “\d” Matches any digit
“\d {4}” Matches exactly four digits

18. Which type of action can only be used by the owner Test?
Ans:- Non-reusable Action - Regular

19. Where would you set action iteration for a specified action?
Ans: - Action Properties

20. What are the types of Recovery Scenario Manager?


Ans: - Pop-Up, Test Run Error, Object and Application crash

21. What are the types of object Repository Mode?


Ans: - (1) Per- Action (2). Shared

22. What does regular Expression allow you to do?


Ans: - To accept the Range of values

Answers
1. Dim
2. GetCurrentRow Method
3. Run-Time Data table in Test Result
4. Action Tab, Corresponding to that Action
5. GetRowCount
6. Import.file path
7. Object Identification
8. Index & location
9. Create Text File, Open Text File, Open Text As Stream
10. (1). Creating, Adding, removing and Reading the data
(2). Moving, Copying and deleting the data
11. To Create a FSO object
12. To View the properties
13. GetRoProperty
14. Save the file as .vbs and Go to Test->Settings->Resources
15. To access the Window API function
16. 20 seconds
17. “\d” Matches any digit
“\d {4}” Matches exactly four digits
18. Non-reusable Action - Regular
19. Action Properties
20. Pop-Up, Test Run Error, Object and Application crash
21. (1) Per- Action (2). Shared
22. To accept the Range of values

Questions:

23. What is the difference between getroproperty and gettoproperty?


24. Steps to connect to a database.
25. How do you point to a particular row in a data table?
26. What is a method to populate a data table?
27. Which are the methods of reading a text string object?
28. What is the use of import sheet method in VBScript?
29. What is the difference between subroutine and functions?
30. Which Utility statement is used to associate a procedure to a test object class?
31. What are the two ways of passing arguments while calling functions?
32. How can you output information into results?
33. How can you declare a variable and a constant in VB Script?
34. What does a set statement do?
35. What is Object Repository?
36. How to change logical Name?
37. How to add objects in the Object Repository?
38. What is the difference between Wait and Wait Property?
39. How to give 5 milliseconds in Wait Property?
40. Need to check if the browser is opened successfully or not? How do achieve this?
41. What is the difference between Test Object and Run Time Object
Properties/methods?
42. Need to capture a text in Web Application using Text Area? How to do it?
43. How to call a function?
44. How to make a function available to entire script? How to give shared Object
Repository in QTP?
45. What is the purpose of Keyword view?
46. How to call Actions?
47. Need to call excel sheet from QTP?
48. What is the difference between Call By Value and Call By Reference? When to use?
49. How to call API Functions?
50. How to handle File system Object?
51. Need capture mouse over event? But while recording Mouse over is not capture?
Why and how to solve it?
52. What are two types of Record and Run Settings?
53. What is the purpose of location, index and how it is handled for Web application?
54. What is a Page and Accessibility Check Point?
Why and when do you use QTP?

QTP is a tool which is used to automate the applications. QTP especially


used to test the Web Applications. Using this tool we can perform GUI
testing, functional testing and database testing.QTP is easy-to-use tool which
can be scripted using VB Script or Java Script. This tool extensively
recognizes the Web objects which are used in web applications.
OR
QTP is an automation tool that will be used for functional Purpose, regersion
purpose test that application different Time with different data and reducing
the time and provide the good quality to customer. And in qtp script will be
Prepare by using vb, java.
OR
QTP is graphical interface record playback automation tool which uses a
scripting language built on top of VBScript to specify the test procedure and
manipulate the objects and controls of the application under test.

Advantages of QTP
Parameterization easier than Win Runner
Quick Test Pro is significantly easier for a non-technical person to adapt to
and create working test cases, compared to Win Runner
Test Run Iterations/Data driving a test is easier and better implementing
with Quick Test.
Better object identification mechanism. Numerous existing functions
available for implementation. Both from within Quick Test Pro and
VBScript.

Questions and Answers

1. When an action is called, after the execution of specific action it Exits action and
returns a value
a. true b. false
Ans: true

2. An external action can be modified.


a. true b. false
Ans: false
3. Per-action can't be accessed as a separate file.
a. true b. false
Ans: true
4. DataTable.DeleteSheet "Global” or DataTable.DeleteSheet 1
a. can be deleted b. No c. Invalid syntax
Ans: can be deleted

5. A test has 3 reusable and 2 non reusable. Then total sheets are
a. 3 b. 2 c. 5 d. None
Ans: 5 (+Global sheet)

6. You can't debug using ---- statement.


a. ExecuteFiles
b. Execute_Files
c. Execute-Files
d. Execute File
Ans: ExecuteFile

7. I/P values for an action can be retrieved from


a. test b. parent action c. o/p of previous action call d. All
Ans: All

8. Specifying i/p, o/p parameter values is


a. optional b. required c. necessary for internal action d. none e. a & b
Ans: optional

9. Exit action exits


a. current action b. current iteration c. Current test d.
Current global iteration
Ans: from the current action

10. Run time object property can be changed using


a. GetRoProperty b. SetRoProperty c. SetToProperty d. none
Ans: SetToProperty

11. ' Action calls’ property dialog box enables to set options that apply onto
-------------- action call
a following b. Preceeding c. specific d. internal
Ans: specific

12. Write a function to identify a word in a sentence?


You pass the sentence and check for the word, say ADP. If
Possible, find how many times it is appeared?
Ans:
13. If I click Yes radio button, an edit box should appear
If I select No radio button it should not appear
And ... one more scenario: - with out selecting any radio button I Want to check
whether that edit box is present or not?
Ans:

14. How do you do Data Driven Automation Testing?


Ans: Convert your test scripts into Data Driven scripts. Data-Driven automated testing
allows you to create automated test scripts that are more "generic". You can specify
different set of data files and script will perform tests with that dataset.

15. Is it possible to do Performance testing in any other way using?


QTP? If not, Why, If yes, How?
Ans:

16. I want to add 3 sheets only (of total 8 sheets) from EXCEL file.
Ans:

17. I have 1000 rows used, in excel sheet, without using loop get the Data of 637th row
based on ID number (it is one column name).
Ans: select object from [FRAPP$] where ID="637";

Column name=object
Excel sheet=FRAPP

18. How to copy environment variables?


Ans: Copying an environment variable PATH, CLASSPATH, JAVA_HOME, etc..
For Windows (from the command line):
echo %CLASSPATH% > my-classpath.txt
Notepad my-classpath.txt
This will open up a text file containing your CLASSPATH environment variable in
notepad;
Where it will be easy to copy to your clipboard.

19. How to display QTP result (present in result window) in Notepad?


Ans:
We will be using a separate Sheet by name "Results" in which the Results of the Test will
be appended.

There are 2 functions

1) initOutExcel(sTablePath)

Description: This function is to initialize a particular Excel where you want to


update The Results of the QTP Tests.
2) WriteResults(sTablePath,sStatus,sFunctionality,sDescription)

Description: This function appends the Result of a Test to the end of the existing
results.

You can modify the below functions to suite your requitrement.

CODE:

Function initOutExcel(sTablePath)

Datatable.addSheet "Results"

Datatable.importSheet sTablePath, "Results","Results"

iParamCount = Datatable.getSheet("Results").getParameterCount

if iParamCount = 0 Then

Datatable.getSheet("Results").addParameter "S.No",""

Datatable.getSheet("Results").addParameter "Status",""

Datatable.getSheet("Results").addParameter "Functionality",""

Datatable.getSheet("Results").addParameter "Description",""

End If

Datatable.ExportSheet sTablePath,"Results"

End Function

Function WriteResults(sTablePath,sStatus,sFunctionality,sDescription)

Datatable.addSheet "Results"

Datatable.importSheet sTablePath, "Results","Results"

iRowCount = Datatable.getSheet("Results").getRowCount

Datatable.getSheet("Results").setCurrentRow(iRowCount+1)

Datatable("S.No","Results") = iRowCount+1

Datatable("Status","Results") = sStatus
Datatable("Description","Results") = sDescription

Datatable("Functionality","Results") = sFunctionality

Datatable.ExportSheet sTablePath,"Results"

End Function

20. Mandatory Prop. Is Html id, Assistive Prop.? Is Title. Then how do
You add them in run time using Descriptive Programming?
Ans:

21. In yahoo mail INBOX, I have 10 mails (there is no Select ALL Checkbox), they have
to be checked and click DELETE Button. (.. No ‘Of mails will vary at runtime...)
How to get the count of Check boxes? (in a frame )
Ans:

To check the no of mails in the mailbox and check no of read and unread mails

Dim aa,bb,rowcount
rowcount=Browser("Gmail - Inbox (1) - ravi.ks82@").Page("Gmail - Inbox (1) -
ravi.ks82@").Frame("c22h37xks63dt").WebTable("Javaregowda, Ashok").RowCount
msgbox "total no mails "& rowcount

For i=0 to rowcount


If Browser("Gmail - Inbox (1) - ravi.ks82@").Page("Gmail - Inbox (1) -
ravi.ks82@").Frame("c22h37xks63dt").WebTable(i,5,"Web
Ements",0).GetROProperty("html tag")="B" then
aa=aa+1
else
bb=bb+1
end if
Next
Msgbox "unread mails"&aa
Msgbox "read mails"&bb

22. How to add VBS file or Text file at Runtime?


You can add library file to Ur script through
Test-->Resources tab here u find option called add file there u Can add Ur files
manually before running the script then
Save it so when ever u open that script attached lib files
Also opened with that script.
1. How Does Run time data (Parameterization) is handled in QTP?
A) You can then enter test data into the Data Table, an integrated Spreadsheet with the
full functionality of Excel, to manipulate data Sets and create multiple test iterations,
without programming, to Expand test case coverage. Data can be typed in or imported
from Databases, spreadsheets, or text files.

2) What is keyword view and Expert view in QTP?


A) Quick Test’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.
Advanced testers can view and edit their tests in the Expert View, which reveals the
underlying industry-standard __VBScript that? Quick Test Professional automatically
generates. Any changes made in the Expert View are automatically synchronized with
the Keyword View.

3) Explain about the Test Fusion Report of QTP?


A) Once a tester has run a test, a TestFusion report displays all aspects of the test run:
a high-level results overview, an expandable Tree View of the test specifying exactly
where application failures occurred, the test data used, application screen shots for
every step that highlight any discrepancies, and detailed explanations of each checkpoint
pass and failure. By combining TestFusion reports with QuickTest Professional, you can
share reports across an entire QA and development team.

4) To which environments does a QTP support?


A) QuickTest Professional supports functional testing of all enterprise environments,
including Windows, Web, NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic,
ActiveX, mainframe terminal emulators, and Web services.

5) What is QTP?
A) QuickTest is a graphical interface record-playback automation tool. It is able to
work with any web, java or windows client application. Quick Test enables you to test
standard web objects and ActiveX controls. In addition to these environments, QuickTest
Professional also enables you to test Java applets and applications and multimedia
objects on Applications as well as standard Windows applications, Visual Basic 6
applications and .NET framework applications...

6) Explain QTP testing process?


A) The QuickTest testing process consists of 6 main phases:
1. 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.

2. 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.
3. 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.
o 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.
o Adding logic and conditional statements to your test enables you to add
sophisticated checks to your test.
4. Debugging your test
If changes were made to the script, you need to debug it to check that it operates
smoothly and without interruption.
5. 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.
6. Analyzing the test results
You examine the test results to pinpoint defects in your application.
7. Reporting defects
As you encounter failures in the application when analyzing test results, you will create
defect reports in Defect Reporting Tool.

7) Explain the QTP Tool interface.


A) It contains the following key elements:
Title bar, displaying the name of the currently open test
Menu bar, displaying menus of QuickTest commands
File toolbar, containing buttons to assist you in managing tests

Test toolbar, containing buttons used while creating and maintaining tests

Debug toolbar, containing buttons used while debugging tests.


Note: The Debug toolbar is not displayed when you open QuickTest for the first time.
You can display the Debug toolbar by choosing View > Toolbars > Debug. Note that
this tutorial does not describe how to debug a test. For additional information, refer to
the QuickTest Professional User's Guide.
Action toolbar, containing buttons and a list of actions, enabling you to view the details
of an individual action or the entire test flow.

Note: The Action toolbar is not displayed when you open QuickTest for the first time.
You can display the Action toolbar by choosing View > Toolbars > Action. If you insert
a reusable or external action in a test, the Action toolbar is displayed automatically. For
additional information, refer to the QuickTest Professional User's Guide . Test pane,
containing two tabs to view your test-the Tree View and the Expert View Test Details
pane, containing the Active Screen
Data Table, containing two tabs, Global and Action, to assist you in parameterizing your
test Debug Viewer pane, containing three tabs to assist you in debugging your test-
Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened
only when a test run pauses at a breakpoint.)
Status bar, displaying the status of the test

8) How QTP recognizes Objects in AUT?


A) 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.

9) What are the types of Object Repository’s in QTP?


A) QuickTest has two types of object repositories for storing object information: shared
object repositories and action object repositories. You can choose which type of object
repository you want to use as the default type for new tests, and you can change the
default as necessary for each new test.
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.

10) Explain the check points in QTP?


A) . A checkpoint verifies that expected information is displayed in a Application while
the test is running. You can add eight types of checkpoints to your test for standard web
objects using QTP.
• A page checkpoint checks the characteristics of a Application

• A text checkpoint checks that a text string is displayed in the appropriate place
on a Application.
• An object checkpoint (Standard) checks the values of an object on a Application.
• An image checkpoint checks the values of an image on a Application.
• A table checkpoint checks information within a table on a Application
• An Accessibility checkpoint checks the web page for Section 508 compliance.
• An XML checkpoint checks the contents of individual XML data files or XML
documents that are part of your Web application.
• A database checkpoint checks the contents of databases accessed by your web
site

11) In how many ways we can add check points to an application using QTP.
A) We can add checkpoints while recording the application or we can add after recording is
completed using Active screen (Note : To perform the second one The Active screen
must be enabled while recording).

12) How does QTP identifies the object in the application?


A) QTP identifies the object in the application by Logical Name and Class.
For example:
The Edit box is identified by
Logical Name: PSOPTIONS_BSE_TIME20
Class: WebEdit

13) If an application name is changes frequently i.e while recording it has name
"Window1" and then while running its "Windows2" in this case how does QTP
handles?
A) QTP handles those situations using "Regular Expressions".

14) What is Parameterizing Tests?


A) When you test your application, you may want to check how it performs the same
operations with multiple sets of data. For example, suppose you want to check how your
application responds to ten separate sets of data. You could record ten separate tests,
each with its own set of data. Alternatively, you can create a parameterized test that
runs ten times: each time the test runs, it uses a different set of data.

15) What is test object model in QTP?


A) The test object model is a large set of object types or classes that QuickTest uses to
represent the objects in your application. Each test object class has a list of properties
that can uniquely identify objects of that class and a set of relevant methods that
QuickTest can record for it.
A test object is an object that QuickTest creates in the test or component to represent the
actual object in your application. QuickTest stores information about the object that will
help it identify and check the object during the run session.
A run-time object is the actual object in your Web site or application on which methods
are performed during the run session.
When you perform an operation on your application while recording, QuickTest:
An identifies the QuickTest test object class that represents the object on which you
performed the operation and creates the appropriate test object reads the current value
of the object's properties in your application and stores the list of properties and values
with the test object chooses a unique name for the object, generally using the value of
one of its prominent properties records the operation that you performed on the object
using the appropriate QuickTest test object method
For example, suppose you click on a Find button with the following HTML source code:
<INPUT TYPE="submit" NAME="Find" VALUE="Find">
QuickTest identifies the object that you clicked as a WebButton test object.
It creates a WebButton object with the name Find, and records the following properties
and values for the Find WebButton:
It also records that you performed a Click method on the WebButton.
QuickTest displays your step in the Keyword View like this:
QuickTest displays your step in the Expert View like this:
Browser("Mercury Interactive").Page("Mercury Interactive").
WebButton("Find").Click

16) What is Object Spy in QTP?


A) Using the Object Spy, you can view the properties of any object in an open
application. You use the Object Spy pointer to point to an object. The Object
Spy displays the selected object's hierarchy tree and its properties and values in the
Properties tab of the Object Spy dialog box.

Supported Check-Points in QTP?


17) What is the Diff between Image check-point and Bit map Check point?
A) Image checkpoints enable you to check the properties of a Web image.
You can check an area of a Web page or application as a bitmap. While creating a test or
component, you specify the area you want to check by selecting an object. You can
check an entire object or any area within an object. QuickTest captures the specified
object as a bitmap, and inserts a checkpoint in the test or component. You can also
choose to save only the selected area of the object with your test or component in order
to save disk Space. For example, suppose you have a Web site that can display a map
of a city the user specifies. The map has control keys for zooming. You can record the
new map that is displayed after one click on the control key that zooms in the map.
Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create bitmap checkpoints for all supported testing environments (as long as
the appropriate add-ins is loaded).
Note: The results of bitmap checkpoints may be affected by factors such as operating
system, screen resolution, and color settings.
18) How many ways we can parameterize data in QTP?
A) There are four types of parameters:
Test, action or component parameters enable you to use values passed from your
test or component, or values from other actions in your test.

Data Table parameters enable you to create a data-driven test (or action) that runs
several times using the data you supply. In each repetition, or iteration, QuickTest uses
a different value from the Data Table.

Environment variable parameters enable you to use variable values from other
sources during the run session. These may be values you supply, or values that
QuickTest generates for you based on conditions and options you choose.

Random number parameters enable you to insert random numbers as values in your
test or component. For example, to check how your application handles small and large
ticket orders, you can have QuickTest generate a random number and insert it in a
number of tickets edit field.

19. How do u do batch testing in WR & is it possible to do in QTP, if so explain?

Ans: Batch Testing in WR is nothing but running the whole test set by selecting "Run
Testset" from the "Execution Grid". The same is possible with QTP also. If our test cases
are automated then by selecting "Run Testset" all the test scripts can be executed. In
this process the Scripts get executed one by one by keeping all the remaining scripts in
"Waiting" mode.

20. What does it mean when a check point is in red color? what do u do?

Ans : A red color indicates failure. Here we analyze the cause for failure whether it is
a Script Issue or Environment Issue or a Application issue.

21. What do you call the window test director - testlab?

Ans : "Execution Grid". It is place from where we Run all Manual /


Automated Scripts

22. How does u create new test sets in TD?

Ans : Login to TD.


Click on "Test Lab" tab.
Select the Desired folder under which we need to Create the Test Set. (Test Sets
can be grouped as per module.)
Click on "New Test Set or Ctrl+N" Icon to create a Test Set.

23. How do u do batch testing in WR & is it possible to do in QTP, if so explain?

Ans : You can use Test Batch Runner to run several tests in succession. The
results for each test are stored in their default location.
Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file,
so that you can easily run the same batch of tests again, at another time. You can also
choose to include or exclude a test in your batch list from running during a batch run.

24. If I give some thousand tests to execute in 2 days what do u do?

Ans : Adhoc testing is done. It covers the least basic functionalities to verify that the
system is working fine.

25. How to Import data from a ".xls" file to Data table during Runtime.

Ans : Datatable.Import "...XLS file name..."

DataTable.ImportSheet(FileName, SheetSource, SheetDest)


DataTable.ImportSheet "C:\name.xls" ,1 ,"name"

26. How to export data present in Datatable to an ".xls" file?

Ans : DataTable.Export "....xls file name..."

27. How to get Traceability matrix from TD?

28. How to import a test case present in ".xls" file to TD under a Test set?

29. How to attach a file to TD?

30. What do you to script when objects are removed from application?

31. Syntax for how to call one script from another and Syntax to call one
"Action" in another?
Ans: RunAction ActionName, [IterationMode , IterationRange , Parameters]

Here the actions become reusable on making this call to any Action.

IterationRange String Not always required. Indicates the rows for which action
iterations will be performed. Valid only when the IterationMode is rngIterations. Enter
the row range (i.e. "1-7"), or enter rngAll to run iterations on all rows.

If the action called by the RunAction statement includes an ExitAction statement, the
RunAction statement can return the value of the ExitAction's RetVal argument.

32. How to export QTP results to an ".xls" file?


Ans : (a) By default it creates an "XML" file and displays the results

33. 3 differences between QTP & Winrunner?


Ans :
(a) QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based)
Scripting.
(b) QTP supports ".NET" application Automation not available in Winrunner
(c) QTP has "Active Screen" support which captures the application, not
available in WR.
(d) QTP has "Data Table" to store script values , variables which WR does not
have.
(e) Using a "point and click" capability you can easily interface with objects,
their definitions and create checkpoints after having recorded a script without having to
navigate back to that location in your application like you have to with WinRunner. This
greatly speeds up script development.

34. How to create a Runtime property for an object?

35. How to add a runtime parameter to a datasheet?

Ans:
DataTable.LocalSheet

The following example uses the LocalSheet property to return the local sheet
of the run-time Data Table in order to add a parameter (column) to it.
MyParam=DataTable.LocalSheet.AddParameter("Time", "5:45")

36. What scripting language is QTP of?

Ans : Vbs

37. Analyzing the Checkpoint results

Standard Checkpoint: By adding standard checkpoints to your tests or components,


you can compare the expected values of object properties to the object's current values
during a run session. If the results do not match, the checkpoint fails.

38. Table and DB Checkpoints:

By adding table checkpoints to your tests or components, you can check that a
specified value is displayed in a cell in a table on your application. By adding database
checkpoints to your tests or components, you can check the contents of databases
accessed by your application.

The results displayed for table and database checkpoints are similar. When you
run your test or component, QuickTest compares the expected results of the checkpoint
to the actual results of the run session. If the results do not match, the checkpoint fails.

You can check that a specified value is displayed in a cell in a table by adding a
table checkpoint to your test or component. For ActiveX tables, you can also check the
properties of the table object. To add a table checkpoint, you use the Checkpoint
Properties dialog box.

Table checkpoints are supported for Web and ActiveX applications, as well as for
a variety of external add-in environments.
You can use database checkpoints in your test or component to check databases
accessed by your Web site or application and to detect defects. You define a query on
your database, and then you create a database checkpoint that checks the results of the
query.

Database checkpoints are supported for all environments supported by


QuickTest, by default, as well as for a variety of external add-in environments.

There are two ways to define a database query:

(a) Use Microsoft Query. You can install Microsoft Query from the custom
installation of Microsoft Office.
(b) Manually define an SQL statement.
The Checkpoint timeout option is available only when creating a table checkpoint.
It is not available when creating a database checkpoint

39. Checking Bitmaps:


You can check an area of a Web page or application as a bitmap. While creating a
test or component, you specify the area you want to check by selecting an object. You
can check an entire object or any area within an object. QuickTest captures the specified
object as a bitmap, and inserts a checkpoint in the test or component. You can also
choose to save only the selected area of the object with your test or component in order
to save disk space.

When you run the test or component, QuickTest compares the object or selected
area of the object currently displayed on the Web page or application with the bitmap
stored when the test or component was recorded. If there are differences, QuickTest
captures a bitmap of the actual object and displays it with the expected bitmap in the
details portion of the Test Results window. By comparing the two bitmaps (expected and
actual), you can identify the nature of the discrepancy. For more information on test
results of a checkpoint, see Viewing Checkpoint Results.

For example, suppose you have a Web site that can display a map of a city the
user specifies. The map has control keys for zooming. You can record the new map that
is displayed after one click on the control key that zooms in the map. Using the bitmap
checkpoint, you can check that the map zooms in correctly.

You can create bitmap checkpoints for all supported testing environments (as
long as the appropriate add-ins is loaded).

Note: The results of bitmap checkpoints may be affected by factors such as


operating system, screen resolution, and color settings.

40. Text/Text Area Checkpoint:

In the Text/Text Area Checkpoint Properties dialog box, you can specify the text
to be checked as well as which text is displayed before and after the checked text. These
configuration options are particularly helpful when the text string you want to check
appears several times or when it could change in a predictable way during run sessions.

Note: In Windows-based environments, if there is more than one line of text


selected, the Checkpoint Summary pane displays [complex value] instead of the
selected text string. You can then click Configure to view and manipulate the actual
selected text for the checkpoint.

QuickTest automatically displays the Checked Text in red and the text before and
after the Checked Text in blue. For text area checkpoints, only the text string captured
from the defined area is displayed (Text Before and Text After are not displayed).

To designate parts of the captured string as Checked Text and other parts as
Text Before and Text After, click the Configure button. The Configure Text Selection
dialog box opens

Checking XML:

XML (Extensible Markup Language) is a meta-markup language for text


documents that is endorsed as a standard by the W3C. XML makes the complex data
structures portable between different computer environments/operating systems and
programming languages, facilitating the sharing of data.

XML files contain text with simple tags that describe the data within an XML
document. These tags describe the data content, but not the presentation of the data.
Applications that display an XML document or file use either Cascading Style Sheets
(CSS) or XSL Formatting Objects (XSL-FO) to present the data.

You can verify the data content of XML files by inserting XML checkpoints. A few
common uses of XML checkpoints are described below:

An XML file can be a static data file that is accessed in order to retrieve
commonly used data for which a quick response time is needed—for example, country
names, zip codes, or area codes. Although this data can change over time, it is normally
quite static. You can use an XML file checkpoint to validate that the data has not
changed from one application release to another.
An XML file can consist of elements with attributes and values (character data).
There is a parent and child relationship between the elements, and elements can have
attributes associated with them. If any part of this structure (including data) changes,
your application's ability to process the XML file may be affected. Using an XML
checkpoint, you can check the content of an element to make sure that its tags,
attributes, and values have not changed.
XML files are often an intermediary that retrieves dynamically changing data from
one system. The data is then accessed by another system using Document Type
Definitions (DTD), enabling the accessing system to read and display the information in
the file. You can use an XML checkpoint and parameterize the captured data values in
order to check an XML document or file whose data changes in a predictable way.
XML documents and files often need a well-defined structure in order to be
portable across platforms and development systems. One way to accomplish this is by
developing an XML schema, which describes the structure of the XML elements and data
types. You can use schema validation to check that each item of content in an XML file
adheres to the schema description of the element in which the content is to be placed.

41. Object Repositories types, which & when to use?


Deciding Which Object Repository Mode to Choose
To choose the default object repository mode and the appropriate object
repository mode for each test, you need to understand the differences between the two
modes.
In general, the object repository per-action mode is easiest to use when you are
creating simple record and run tests, especially under the following conditions:
You have only one, or very few, tests that correspond to a given application,
interface, or set of objects.
You do not expect to frequently modify test object properties.
You generally create single-action tests.
Conversely, the shared object repository mode is generally the preferred mode
when:
You have several tests that test elements of the same application, interface, or
set of objects.
You expect the object properties in your application to change from time to time
and/or you regularly need to update or modify test object properties.
You often work with multi-action tests and regularly use the Insert Copy of Action
and Insert Call to Action options.

42. Can we Script any test case with out having Object repository? or Using
Object Repository is a must?
Ans: No. U can script with out Object repository by knowing the Window
Handlers, spying and recognizing the objects logical names and properties available.

43. How to execute a WinRunner Script in QTP?


Ans : (a) TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP 6.0
used for backward compatibility
Parameters : The test set within Quality Center, in which test runs are
stored. Note that this argument is relevant only when working with a test in a Quality
Center project. When the test is not saved in Quality Center, this parameter is ignored.
e.g : TSLTest.RunTest "D:\test1", ""

(b)
TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ]
TSLTest.RunTestEx "C:\WinRunner\Tests\basic_flight", TRUE, FALSE, "MyValue"
CloseApp : Indicates whether to close the WinRunner application when the
WinRunner test run ends.
Parameters : Up to 15 WinRunner function argument

44. How to handle Run-time errors?


(a) On Error Resume Next : causes execution to continue with the statement
immediately following the statement that caused the run-time error, or with the
statement immediately following the most recent call out of the procedure containing the
On Error Resume Next statement. This allows execution to continue despite a run-time
error. You can then build the error-handling routine inline within the procedure.
Using "Err" object msgbox "Error no: " & " " & Err.Number & " "&
Err.description & " " & Err.Source & Err.HelpContext

45. How to change the run-time value of a property for an object?


Ans : SetTOProperty changes the property values used to identify an object
during the test run.
Only properties that are included in the test object description can be set

46. How to retrieve the property of an object?


Ans : using "GetRoProperty".

47. How to open any application during Scripting?


Ans : SystemUtil , object used to open and close applications and processes
during a run session.
(a) A SystemUtil.Run statement is automatically added to your test when you run
an application from the Start menu or the Run dialog box while recording a test
E.g : SystemUtil.Run "Notepad.exe"
SystemUtil.CloseDescendentProcesses (Closes all the processes opened by QTP)
48. Types of properties that Quick Test learns while recording?
Ans : (a) Mandatory (b) Assistive .
In addition to recording the mandatory and assistive properties specified
in the Object Identification dialog box, QuickTest can also record a backup ordinal
identifier for each test object. The ordinal identifier assigns the object a numerical value
that indicates its order relative to other objects with an otherwise identical description
(objects that have the same values for all properties specified in the mandatory and
assistive property lists). This ordered value enables QuickTest to create a unique
description when the mandatory and assistive properties are not sufficient to do so.

49. What is the extension of script and object repository files?


Ans : Object Repository : .tsr , Script : .mts, Excel : Default.xls

50. How to supress warnings from the "Test results page"?


Ans : From the Test results Viewer "Tools > Filters > Warnings"...must be
"Unchecked".

51. When we try to use test run option "Run from Step", the browser is not
launching automatically why?
Ans : This is default behaviour.

52. Does QTP is "Unicode" compatible?


Ans : QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatabile by end of
December 2004.

53. How to "Turn Off" QTP results after running a Script?


Ans : Goto "Tools > Options > Run Tab" and Deselect "View results when run
session ends". But this supresses only the result window, but a og will be created and
can viewed manulaly which cannot be restricted from getting created.

54. How to get "FontSize" of a "WebEdit"?

55. Is there anyway to automatically update the Datasource name in Database


Checkpoints object when we migrate tests to a new release?

56. How to verify the Cursor focus of a certain field?


Ans : Use "focus" property of "GetRoProperty" method"

57. Any limitation to XML Checkpoints?


Ans : Mercury has determined that 1.4MB is the maximum size of a XML file that
QTP 6.5 can handle

58. How to make arguments optional in a function?

Ans : this is not possible as default VBS doesn't support this. Instead you can
pass a blank scring and have a default value if arguments r not required.
59. How to covert a String to an integer?
Ans : CInt()---> a conversion function available.

60. Inserting a Call to Action is not importing all columns in Datatable of


globalsheet. Why?
Ans : Inserting a call to action will only Import the columns of the Action called
61. What is the Base Line of executing script?

Ans : There are 3 level

1 child work space


2 integrate work space
3 master work space

Child : ideally executing the script being level .and perform it.

Integrating : integrating all the script and executing by gatekeeper. If get the any error in
the send to the child work space.And once the get executing it. Will send into the
Master work space.

Master :

You might also like