- QTP Tutorial
- QTP - Home
- QTP - Introduction
- QTP - Test Automation
- QTP - Environment Setup
- QTP - Record and Play Back
- QTP - Object Repository
- QTP - Actions
- QTP - DataTables
- QTP - Checkpoints
- QTP - Synchronization
- QTP - Smart Identification
- QTP - Debugging
- QTP - Error Handling
- QTP - Recovery Scenarios
- QTP - Environment Variables
- QTP - Library Files
- QTP - Test Results
- QTP - GUI Objects
- QTP - Virtual Objects
- QTP - Accessing Databases
- QTP - Working with XML
- QTP - Descriptive Programming
- QTP - Automation Object Model
- QTP - Frameworks
- QTP - Designing a Framework
- QTP Useful Resources
- QTP - Questions and Answers
- QTP - Quick Guide
- QTP - Useful Resources
- QTP - Discussion
QTP Mock Test
This section presents you various set of Mock Tests related to QTP Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
QTP Mock Test III
Q 1 - Where is the System Monitor tab located?
Answer : A
Explanation
In the right pane of the Test Results window, the system monitor tab is located.
Q 2 - What happens when you import data from an external Excel file into the UFT Data Table?
A - Row data is overwritten when column headers in Excel and the Data Table match.
B - A new column is added to the Data Table when column headers in Excel and the Data Table match.
C - All the sheets in the Excel file are imported.
D - Excel listboxes are expanded and one row is added to the Data Table per value in the list.
Answer : C
Explanation
All the sheets in the Excel file are imported.
Q 3 - Which statement should you use to export all sheets in the Data Table?
A - DataTable.Export ("C:\flights.xls")
B - DataTable.ExportSheet ("C\flights.xls.", ALL)
Answer : A
Explanation
DataTable.Export (Filename) to be used to export all sheets in a datatable.
Q 4 - Which statement will retrieve the test object's properties during the test run?
A - iCount = WebRadioGroup("seat").GetROProperty("Items Count")
B - WebRadioGroup("seat).CheckProperty("Items Count")
Answer : C
Explanation
GetTOProperties fetches test object's properties during the test run.
Q 5 - Which method retrieves a property of a runtime object?
Answer : A
Explanation
GetROProperty retrieves a property of a runtime object.
Q 6 - What is the correct syntax for a programmatic description?
A - WebEdit("Name:=Author" , Index:=3)
B - WebEdit("Name:=Author" , "Index:=3")
Answer : B
Explanation
WebEdit("Name:=Author" , "Index:=3") is the correct syntax of descriptive programming.
Q 7 - Why would a tester use the Description object in the Expert View of a test?
A - to programmatically modify a test object's definition directly in the object repository
B - to bypass the object repository when identifying an object at runtime
C - to data-drive logical names and make the test more generic
D - to make it easier to retrieve child objects using the ChildObjects method
Answer : B
Explanation
To avoid the object repository when identifying an object at runtime.
Q 8 - What does the dot indicate in VBScript? (Select two.)
property
child object
statement
function
method
Answer : D
Explanation
child object or method will follow after a dot in vbscript.
Q 9 - When is it best to use a programmatic description?
A - when you work with properties and methods of an object not in the object repository
B - when you are retrieving a property from a static run-time object
Answer : A
Explanation
If is best to use when we work with properties and methods of an object not in the object repository.
Q 10 - Which operator do you use to concatenate two strings in VBScript?
Answer : A
Explanation
Concatenation can be done either by using & or using '+'
Q 11 - Which DataTable method makes an external spreadsheet available to UFT?
Answer : C
Explanation
ImportSheet method makes an external spreadsheet available to UFT.
Q 12 - The capture levels available for active screen page are
A - None, Minimum, Medium, Maximum
Answer : D
Explanation
There are four capture levels available in UFT - None, Minimum, Partial and Complete. Can be found under Tools > Options> Active Screen.
Q 13 - What happens when you hit debug button on a run error message box during a run session?
B - attempts to perform the step again.
Answer : D
Explanation
UFT suspends the run session and enable you to debug the test.
Q 14 - When UFT detects a syntax error, it automatically displays the errors at
Answer : B
Explanation
When you save a script or switch from the views, UFT checks for syntax errors and if information pane is not open then it automatically opens the pane and displays errors.
Q 15 - What is the shortcut key for File > New > Scripted Component
Answer : D
Explanation
There is no any shortcut key defined for new scripted component.
Q 16 - What is the maximum number of characters limit that can be displayed in comments tab available under ToDo Pane?
Answer : B
Explanation
The text displayed in the comments tab is limited to 260 characters. If it exceeds, the comments can be viewed by jumping to the comment statement.
Q 17 - How does active screen capture information on objects for a web based application?
A - It downloads and stores images and other resources on the page
B - It stores the path to images and other resources on the page
C - It saves images and resources in the object repository
D - It does not store any information to images and resources
Answer : B
Explanation
Active screen stores the path to images and other resources on the page.
Q 18 - What is the shortcut key to expand all the branches in the keyword view?
Answer : D
Explanation
Asterisk can be used to expand all the branches in the keyword view.
Q 19 - What happens during a run session, if an object is contained in both local and shared repositories.
A - QTP uses objects from Shared Repository
Answer : B
Explanation
If an action uses an object contained in both local and shared repository QuickTest always searches for and uses objects in the local object repository.
Q 20 -If you need to add the steps or update the object repository while running your test, which run mode can be used?
Answer : B
Explanation
Maintenance Run mode can be used to repair your test during run session.
Q 21 - The Documentation cell in Keyword view is ____________.
Answer : A
Explanation
You cannot edit documentation cell in keyword view.
Q 22 - When you insert a new step using step generator, where does it get added?
Answer : B
Explanation
When you add a new step using step generator, it is added to the test after the selected step.
Q 23 - Select the correct statement
A - Low level recording can be done only when you are in Expert view.
B - Low level recording can be done only when you are in Keyword view.
C - Low level recording can be done only when you are in Normal recording mode.
D - Low level recording can be done only when you are in Analog recording mode.
Answer : C
Explanation
Low level recording can be done only when you are in normal recording mode.
Q 24 - If you have not saved your test with active screen files and later you want to edit your test using active screen options. How can you regenerate the active screen information?
A - you can not edit it now, test should be re-designed.
B - performing the maintenance run.
Answer : C
Explanation
Active screen can be regenerated by performing the update run.
Q 25 - Which built-in environment variable indicates the test iteration running currently?
Answer : B
Explanation
TestIteration indicates which test iteration is currently running.
Q 26 - If a non-reusable action is stored with your test and is called only once in the test, how does it affect the test if you remove this action?
A - deletes the selected call to the action.
C - deletes the selected call to the action without affecting the action in source test.
D - deletes it entirely, including its corresponding action sheet.
Answer : D
Explanation
When you remove a non-reusable action which is stored with the test and called only once, deletes it entirely including the action sheet from data table.
Q 27 - Which of the following file is recognized as an action template?
Answer : A
Explanation
Only the file name ActionTemplate.mst is recognized as an action template.
Q 28 - If you have defined an input parameter for an action as "TestId", which of the following can be used to retrieve this parameter value?
Answer : B
Explanation
Input or output action parameter names are case sensitive.
Q 29 - You need to run an action (Action1) for one iteration with 2 inputs ("input1? and "input2?) and 1 output (output1) parameter but you just want to pass only 1 input("input1?) parameter and get the output, which of the below statements can be used in such a scenario?
A - RunAction "Action1", oneIteration, "input1", ,output1
B - RunAction "Action1", oneIteration, "input1", output1
Answer : A
Explanation
Parameters should be passed in the same order as they are specified for an action. All input parameters should be passed first and then output parameters.
Q 30 - A checkpoint returns a _________ value.
Answer : C
Explanation
Checkpoint returns a Boolean value.
Q 31 - How can you create a table checkpoint?
A - by inserting a standard checkpoint on a table object.
B - by inserting a Image checkpoint on a table object.
C - by inserting a Page checkpoint on a table object.
D - by inserting a Accessibilty checkpoint on a table object.
Answer : A
Explanation
Table checkpoint can be created by inserting a standard checkpoint on a table object.
Answer : D
Explanation
Shortcut key for the standard checkpoint is F12.
Q 33 - What are the options available to define a table checkpoint at 'define/modify row range' dialog box?
A - All Range, Visible Range and Another Range
B - All Rows, Visible Rows and Another Range
Answer : B
Explanation
There are three options are there to define table checkpoint row range – All Rows, Visible Rows and Another Range
Q 34 - You can specify the maximum number of rows at Database checkpoint wizard, that you would like to limit the wizard to check or output. What is the maximum limit that you can specify here?
Answer : C
Explanation
You can specify a maximum of 32000 rows.
Q 35 - You decided to parameterize a value using Random Number parameter, what option you will choose to generate a new number and use it for the parameter throughout the test?
A - Generate new random number for each action iteration
B - Generate new random number once per entire test run
Answer : B
Explanation
Select ‘Generate new random number once per entire test run’ generates a new number which can be used throughout the test.
Q 36 - Result.qtp file at Test Result Location stores all information on each of the test result nodes that are displayed in Test Result Viewer.
Answer : B
Explanation
The file that stores information about the test result nodes is Results.xml and not Result.qtp
Q 37 - You can use regular expressions to define the value range for a checkpoint.
Answer : A
Explanation
Regular expression can be used in checkpoint to define the value range.
Q 38 - What is the difference between a function and a sub procedure?
A - function can return a value whereas a sub procedure cannot
B - sub procedure can return a value whereas a function cannot
Answer : A
Explanation
The main difference between function and sub procedure is that function can return a value whereas sub procedure.
Q 39 - What is the value of x in the following piece of code :
Dim a(10)
a(0) = 10
a(1) = 20
a(2) = 30
x = UBOUND(a)
Answer : C
Explanation
UBound returns the largest subscript for the dimension of an array.
Q 40 - Which function is used to create an object of specified type?
Answer : B
Explanation
CreateObject is used to create an object of specified type.
Q 41 - You have created a virtual object collection and now you don't want to use it , what should you do to disable it?
A - Disable virtual objects in Object Identification
B - Disable virtual objects in General options
Answer : B
Explanation
To disable a virtual object collection, select ‘Disable virtual objects in General options'.
Q 42 - When you use Option Explicit and try to use an undeclared variable name, what is the error that occurs?
B - Option Explicit Violation Error
Answer : A
Explanation
Using an undeclared variable implicitly will cause an error - Variable is unidentified.
Q 43 - If the local data table contains 5 rows and global data table contains 2 rows, how many times the test will iterate?
Answer : D
Explanation
Test will iterate for each of the rows in global datasheet. Hence 10 is the correct answer
Q 44 - There are 4 tests and you need to call all of them in a main script, how is this possible in QTP?
A - No this is not possible in QTP. Tests cannot be called.
B - You can call all tests using RunAction statement directly
D - You can call all tests using LoadAndRunAction statement directly
Answer : C
Explanation
To call a test script in another script, you need to make the actions in corresponding script reusable.
Q 45 - Which function returns the starting position of the substring or a 0 if the function doesn't find the string?
Answer : D
Explanation
INSTR function is used to locate a substring in a string.
Q 46 - How can you declare a variable in UFT?
Answer : A
Explanation
A variable should not begin with a numeric character and should not contain an embedded period.
Q 47 - What happens, if QTP cannot successfully use the smart identification feature to recognize an object ?
A - Test Result receives a pass status and shows the smart identification information
B - Test Result receives a fail status and shows the smart identification information
C - Test Result receives a warning status and shows the smart identification information
D - Test Result shows fail status and normal fail step displays
Answer : D
Explanation
If the Smart Identification mechanism cannot successfully identify the object, the test fails and a normal failed step is displayed in the Test Results.
Q 48 - While comparing two object repository using Object Repository Comparison tool, If the same object is contained in both repositories but with different names, how this will be shown in repository?
Answer : B
Explanation
If the same object is contained in both the object repositories but with different names, they will be shown in the object repositories as two separate objects.
Q 49 - What is the equivalent method available in vbscript for ExecuteFile method in UFT?
Answer : A
Explanation
The ExecuteFile statement utilizes the VBScript ExecuteGlobal statement.
Q 50 - What will happen if more than one function of same name exists in the test or function library.
A - UFT stops and returns error
B - UFT gives a warning and continue running
Answer : C
Explanation
When more than one function with the same name exists in the test script or function library, the last function will always be called.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | A |
2 | C |
3 | A |
4 | C |
5 | A |
6 | B |
7 | B |
8 | D |
9 | A |
10 | A |
11 | C |
12 | D |
13 | D |
14 | B |
15 | D |
16 | B |
17 | B |
18 | D |
19 | B |
20 | B |
21 | A |
22 | B |
23 | C |
24 | C |
25 | B |
26 | D |
27 | A |
28 | B |
29 | A |
30 | C |
31 | A |
32 | D |
33 | B |
34 | C |
35 | B |
36 | B |
37 | A |
38 | A |
39 | C |
40 | B |
41 | B |
42 | A |
43 | D |
44 | C |
45 | D |
46 | A |
47 | D |
48 | B |
49 | A |
50 | C |
To Continue Learning Please Login
Login with Google