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.

Questions and Answers

QTP Mock Test III

Answer : A

Explanation

In the right pane of the Test Results window, the system monitor tab is located.

Answer : A

Explanation

DataTable.Export (Filename) to be used to export all sheets in a datatable.

Answer : C

Explanation

GetTOProperties fetches test object's properties during the test run.

Q 5 - Which method retrieves a property of a runtime object?

A - GetROProperty

B - GetTOProperty

C - GetRuntimeObjectProperty

D - GetRTProperty

Answer : A

Explanation

GetROProperty retrieves a property of a runtime object.

Answer : B

Explanation

WebEdit("Name:=Author" , "Index:=3") is the correct syntax of descriptive programming.

Q 8 - What does the dot indicate in VBScript? (Select two.)

  1. property

  2. child object

  3. statement

  4. function

  5. method

A - (1) and (3) only

B - (2) and (4) Only

C - (4) and (5) Only

D - (2) and (5) only

Answer : D

Explanation

child object or method will follow after a dot in vbscript.

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?

A - &

B - &&

C - concat

D - ++

Answer : A

Explanation

Concatenation can be done either by using & or using '+'

Q 11 - Which DataTable method makes an external spreadsheet available to UFT?

A - GetSheet

B - OpenSheet

C - ImportSheet

D - ExportSheet

Answer : C

Explanation

ImportSheet method makes an external spreadsheet available to UFT.

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?

A - stops the run session.

B - attempts to perform the step again.

C - skips the step and continue execution.

D - suspends the run session.

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

A - Missing Resource pane

B - Information pane

C - Debug Viewer pane

D - Resource pane

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

A - CTRL+N

B - CTRL+SHIFT+N

C - CTRL+ALT+N

D - No Shortcut available

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?

A - 250

B - 260

C - 255

D - 32

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.

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?

A +

B -

C ctrl+ENTER

D *

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

B - QTP uses objects from Local Repository

C - Run Error occurs

D - QTP does not identify the object and skip the step.

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?

A - Normal Run mode

B - Maintenance Run mode

C - Update Run mode

D - Debug mode

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 ____________.

A - Read-only

B - Write-only

C - Read-Write

D - read, write and execute

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?

A - by replacing the current step.

B - after the selected step.

C - at the beginning of steps

D - at the end of steps.

Answer : B

Explanation

When you add a new step using step generator, it is added to the test after the selected step.

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.

C - performing the update run.

D - Saving the active screens resources with test.

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?

A - Action Iteration

B - TestIteration

C - Iteration Id

D - IterationID

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.

B - deletes it entirely.

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?

A - ActionTemplate.mst

B - ActionTemplate.mts

C - ActionTemplate.qsr

D - ActionTemplate.tmp

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?

A - Parameter("TESTID")

B - Parameter("TestId")

C - Parameter("testid")

D - Parameter("TestID")

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

C - RunAction "Action1", 1, "input1", output1

D - RunAction "Action1", 1, "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.

A - Integer

B - Float

C - Boolean

D - Checkpoint does not return a value

Answer : C

Explanation

Checkpoint returns a Boolean value.

Answer : A

Explanation

Table checkpoint can be created by inserting a standard checkpoint on a table object.

Q 32 - What is the shortcut key for the standard checkpoint?

A - F8

B - F10

C - F11

D - F12

Answer : D

Explanation

Shortcut key for the standard checkpoint is F12.

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?

A - 65356

B - 65000

C - 32000

D - 32400

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

C - Generate new random number for each test iteration

D - None of these

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.

A - True

B - False

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.

A - True

B - False

Answer : A

Explanation

Regular expression can be used in checkpoint to define the value range.

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)

A - 0

B - 3

C - 10

D - 30

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?

A - Description.Create

B - CreateObject

C - Object.Create

D - Object.Createtype

Answer : B

Explanation

CreateObject is used to create an object of specified type.

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?

A - Variable is undefined

B - Option Explicit Violation Error

C - Value cannot be assigned to variable

D - General Run 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?

A - 1

B - 2

C - 5

D - 10

Answer : D

Explanation

Test will iterate for each of the rows in global datasheet. Hence 10 is the correct answer

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?

A - SPLIT

B - MID

C - REVSTR

D - INSTR

Answer : D

Explanation

INSTR function is used to locate a substring in a string.

Q 46 - How can you declare a variable in UFT?

A - Dim MyVar

B - Dim 123MyVar

C - Dim MyVar, 123MyVar

D - Dim My.Var

Answer : A

Explanation

A variable should not begin with a numeric character and should not contain an embedded period.

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?

A - as a single object

B - as two separate objects

C - removes the objects

D - there will be a conflict

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?

A - ExecuteGlobal

B - ExecuteLocal

C - Execute

D - ExecuteFile

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

C - UFT always considers the last function

D - UFT always considers the first function

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
qtp_questions_answers.htm
Advertisements