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 I

Q 1 - When you create a bitmap checkpoint, UFT captures only the visible part of the object as bitmap, it does not capture anything which is scrolled off the screen.

A True

B False

Answer : A

Explanation

QTP/UFT captures only the visible part of the object when using bitmap checkpoint

Q 2 - An action cannot be splitted when :

  1. An external action is selected.

  2. The first step of an action is selected

  3. A reusable action is selected

  4. Recording a test

A - 1 only

B - (2) and (3) Only

C - (1) (2) and (4) Only

D - All the Above

Answer : C

Explanation

An action cannot be splitted when an external or reusable action is selected or in a record session.

Q 3 - How do you Interrupt/Pause a running session ?

  1. Automation > Pause.

  2. Run > Pause

  3. Tools > Pause

  4. Clicking on Pause button at toolbar

  5. Pressing Pause Keyboard button

A - (1) only

B - (2) Only

C - (2) (4) and (5) Only

D - (2) and (4) only

Answer : C

Explanation

A run session can be paused by pressing Pause keyboard button or Clicking the pause button or selecting Run > Pause menu option.

Q 4 - You can remove the call to an action from a test by selecting the action using

  1. Resource pane

  2. Test Flow pane

  3. Keyword view

  4. Expert view

A - (1) and (3) only

B - (2) and (4) Only

C - (1) (2) and (3) Only

D - (3) and (4) only

Answer : C

Explanation

An action call can be removed from the test either from Keyword view or Resource or Test flow pane.

Q 5 - Which of the tool(s) is/are available along with the installation of UFT?

  1. Silent Test Runner

  2. Test Batch Runner

  3. Script Batch Runner

  4. Test Result Creation Tool

  5. HP Video Player

  6. Remote Agent

A - (1) (2) and (3) only

B - (4) (5) and (6) Only

C - (1) (4) and (5) Only

D - (1) (2) and (6) only

Answer : D

Explanation

The tools that are available along with the installation of UFT are Silent Test Runner, Test Batch Runner, Remote Agent, HP Micro Player, Test Result Deletion tool.

Q 6 - When you call a sub procedure, you can use the call statement as

  1. call mySubProc(argument)

  2. Also,you can omit the call statement and just use − mySubProc(argument)

A - True

B - False

Answer : B

Explanation

When you don't use call statement, parenthesis can not be used while calling a sub.

Q 7 - Can you enhance your test by parameterizing the values used. Which of the following are valid parameter type and can be used in your test?

  1. Test/Action parameters

  2. Data table parameters

  3. Environment variable parameter

  4. Recovery Parameters

  5. Resources parameters

A - (1) and (3) only

B - (2) and (4) Only

C - (1) (2) and (3) Only

D - (3) and (4) only

Answer : C

Explanation

There are four types of parameters in UFT – Test/Action parameter, Data table parameter, Environment variable parameter and Random number parameter.

Q 8 - How do you call a function created within your test?

Function Flight(x)
 .. ... ...       
End Function      
  1. Call Flight z

  2. Call Flight(z)

  3. n = Flight(z)

  4. n = Flight z

A - (1) (2) and (4) only

B - (2) and (3) only

C - (1) and (4) only

D - All (1) (2) (3) and (4)

Answer : B

Explanation

Parenthesis should be used while calling a function using a call statement or assigning to a variable.

Q 9 - What information is displayed at System Monitor Tab in test result ?

  1. Application Name, Counter scale, Current Step

  2. Application Name, Product Name, System Information

  3. System Counter List, Maximum Counter Value

  4. System Information, Application Name and System Counter List

A - (1) and (3) only

B - (2) and (4) Only

C - (3) Only

D - (4) only

Answer : A

Explanation

System Monitor tab displays information related to Application Name, Counter Scale, Current Step, System Counter List, Maximum Counter Value. It does not show information related to Product Name or System information.

Q 10 - While merging two object repositories using Merge Tool, if an object in the secondary repository has the same name, description properties and values as an object in the primary object repository which has some additional properties and values, how this conflict can be handled?

  1. By keeping the object added from the primary object repository only.

  2. By keeping the object added from secondary repository only.

  3. By keeping the object added from both the repository.

  4. by ignoring both repository and adding a fresh new object.

A - (1) (2) and (3) only

B - (2) and (4) Only

C - (2) and (3) Only

D - (3) and (4) only

Answer : A

Explanation

You can handle this conflict by either adding objects from primary object repository only or only from secondary object repository or both..

Q 11 - How can you can hide Item column in keyword view?

  1. Right click on column header and unselect item

  2. Right click select 'view options' and remove item from visible column list

  3. Select Item column at Tools > View Options

  4. you cannot hide Item column in keyword view

A - (1) and (3) only

B - (1) and (2) Only

C - (1) (2) and (3) Only

D - (4) only

Answer : A

Explanation

You can hide a column in keyword view by right clicking on column header and unselect the header name or select view Option and remove the header from visible column list.

Q 12 - Steps recorded using Analog recording can be editable in keyword view.

A - True

B - False

Answer : B

Explanation

We cannot edit Analog recording steps

Q 13 - Mark all the ways that can be used to share values between actions.

  1. using Global Data Table

  2. using Environment Variables

  3. using sendparameter command

  4. using Dictionary Objects

A - (1) and (2) only

B - (1) (2) and (4) Only

C - (1) (2) and (3) Only

D - All (1) (2) (3) and (4)

Answer : B

Explanation

Global data table, environment variables and dictionary object can be used to share values among actions.

Q 14 - Which of these checkpoints does not require the test to be in recording mode?.

  1. Standard checkpoint

  2. Database checkpoint

  3. XML checkpoint

  4. Page checkpoint

  5. Bitmap Checkpoint

A - (1) and (2) only

B - (1) (2) and (4) Only

C - (2) and (3) Only

D - All (1) (2) (3) and (4)

Answer : C

Explanation

You can insert database and xml checkpoint without being in recording mode.

Q 15 - Which of the following statement can be used if you want a run session to wait until the a webedit field is enabled?.

  1. Browser("Browser").Page("Page").WebEdit("Edit").WaitProperty("disabled",0)

  2. Browser("Browser").Page("Page").WebEdit("Edit").WaitProperty("disabled",1)

  3. Browser("Browser").Page("Page").WebEdit("Edit").WaitProperty("enabled",1)

  4. Browser("Browser").Page("Page").WebEdit("Edit").Enabled = True

  5. Browser("Browser").Page("Page").WebEdit("Edit").Enabled(5)

  6. Browser("Browser").Page("Page").WebEdit("Edit").Enabled = True

A - (1) and (3) only

B - (1) (3) and (5) Only

C - (2) (4) and (6) Only

D - (1) (2) (4) and (6)

Answer : A

Explanation

You can either use enabled or disabled property to check whether webEdit field is enabled. if enabled value will be 1 else 0.

Q 16 - How can you open a process that is available for currently open document?

  1. File > Process Guidance Management

  2. Automation > Process Guidance List

  3. Process Guidance Pane

  4. we cannot open a process.

A - (1) and (3) only

B - (2) and (4) Only

C - (2) and (3) Only

D - (1) and (4) only

Answer : C

Explanation

A Process can be viewed in Process Guidance Pane and also can be opened by selecting Automation > Process Guidance list.

Q 17 - There is no need to specify HP ALM / QC in the list of browser to ignore at Record and Run settings dialog box..

A - False

B - True

Answer : B

Explanation

By Default, UFT ignores all instances of HP ALM / Quality center.

Q 18 - What type of image format UFT supports for CaptureBitmap method?

  1. bmp

  2. jpg

  3. png

  4. gif

A - (1) and (2) only

B - (1) (2) and (4) Only

C - (1) and (3) Only

D - All (1) (2) (3) and (4)

Answer : C

Explanation

UFT supports only bmp and png types only using captureBitmap Method.

Q 19 - You can modify the concurrent license server.

  1. using License Wizard

  2. by setting LSHOST user variable

  3. by setting LSFORCEHOST user variable

  4. at Help > About dialog box

A - (1) and (2) only

B - (1) (2) and (4) Only

C - (1) (2) and (3) Only

D - All (1) (2) (3) and (4)

Answer : C

Explanation

Concurrent license server details can be modified using License Wizard or by setting LSHOST or LSFORCEHOST user variable. It cannot be modified using Help > About Dialog box

Q 20 - UFT license type that is specific to a computer on which it is installed is known as ________

  1. Concurrent license

  2. Floating license

  3. Seat License

  4. Personal License

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D - All (1) (2) (3) and (4)

Answer : B

Explanation

Seat license is specific to a computer on which it is installed.

Q 21 - You can copy and paste OR drag-drop steps to move the steps to a different location in Keyword view.

A - True

B - False

Answer : A

Explanation

Copy paste and drag drop steps can be done to move steps to a different location in Keyword view.

Q 22 - Recovery Scenarios, Object Repository per Action and Shared Object Repository carry extensions

A - qrs, mtr and mtb respectively

B - qrs, mtr and tsr respectively

C - qrs, mtb and mts respectively

D - qrs, mst and mts respectively

Answer : B

Explanation

File Extensions for a Recovery scenario file is ‘qrs’, for Per Action Object Repository – ‘mtr’,shared object repository -‘tsr’ Batch Test – ‘mtb’, Script file – ‘mts’ for action template – ‘mst’.

Q 23 - Which of the following statements is/are false ?

  1. UFT is an object based testing tool.

  2. UFT is a Protocol based testing tool.

  3. UFT is a Functional and Regression testing tool.

  4. UFT is an open source testing tool.

A - (1) (2) and (3) only

B - (1) and (3) Only

C - (2) and (4) Only

D - All (1) (2) (3) and (4)

Answer : C

Explanation

UFT is neither a Protocol based testing tool nor a open source testing tool.

Q 24 - Using 'Save Test with resources', UFT saves a copy of any external action used.

A - False

B - True

Answer : B

Explanation

UFT always saves a copy of external action used when using 'Save Test with Resources'.

Q 25 - Which of the following could be possible objective(s) for test automation? Mark all that apply.

  1. Increase speed of testing

  2. Reduce manual effort

  3. Ensure consistency

  4. Eliminate manual testing.

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D - All (1) (2) (3) and (4)

Answer : A

Explanation

Automating a test, provides you an increased speed of your testing, it reduces manual effort and ensures consistency, It does not replace manual testing.

Q 26 - Which property/method can be used as custom checkpoints in UFT?

  1. Wait

  2. Exist

  3. Sync

  4. GetROProperty

A - (1) (2) and (3) only

B - (1) (2) and (4) Only

C - (1) and(3) Only

D - (2) and (3)

Answer : D

Explanation

Exist and Sync can be used as custom checkpoints.

Q 27 - What can be used to capture timings in your test?

  1. StartTransaction and EndTransaction

  2. StartTime and EndTime

  3. Timer

  4. Sync

A - (1) (2) and (3) only

B - (3) and (4) Only

C - (1) and (3) Only

D - (2) and (4)

Answer : C

Explanation

StartTransaction and EndTransaction can be used to capture timings, instead of this you can also use Timer function.

Q 28 - Which of the following is a recovery operation available in UFT?

  1. Click Button with label

  2. Click Link with Text

  3. Click Default Button/Press the Enter Key

  4. Click Cancel Button/Press the Enter Key

  5. Mouse Left/Right Click

  6. Press Key or Key Combination

A - (1) (2) and (6) only

B - (1) and (3) Only

C - (1) (2) and (3) Only

D - (3) (4) and (5) Only

Answer : A

Explanation

The valid recovery operations are Click Default Button/Press the Enter Key, Click Cancel Button/Press the Escape Key, Click Button with Label and Press Key or Key Combination.

Q 29 - While creating a database checkpoint, you can define your database query ________

  1. Using Connectionstring

  2. Using Microsoft Query

  3. Using Microsoft Debugger

  4. By Manually defining a SQL Statement

A - (2) and (4) only

B - (3) Only

C - (1) and(3) Only

D - (2) and (3)

Answer : A

Explanation

A database query can be defined by using Microsoft Query or by Manually defining a SQL statement.

Q 30 - 'Exit For' can be used as an alternate way to exit from the loop of _______________.

  1. Do...While

  2. For...Loop

  3. For...Next

  4. For Each...Next

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D -(3) and (4) only

Answer : D

Explanation

Exit For can be used to exit from a For..Next and For Each Next loop.

Q 31 - Why do you use Add-in Manager?

  1. to open UFT.

  2. to load objects and properties for testing your application

  3. to load support for testing your application.

  4. to create object repository for testing your application

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D - All (1) (2) (3) and (4)

Answer : B

Explanation

You use the Add-in Manager to load support for testing your applications.

Q 32 - Which function can be used to convert data from one subtype to another?

  1. Date

  2. Format

  3. CInt

  4. CStr

A - (2) (3) and (4) only

B - (3) Only

C - (1) and(3) Only

D - (3) and (4) only

Answer : D

Explanation

CInt converts to Integer and CStr converts to string.

Q 33 - You can use a checkpoint as in the statement below

Browser("Browser").Page("Page").check CheckPoint("text:=sometext")

A - True

B - False

Answer : B

Explanation

Descriptive programming can not be used with checkpoints.

Q 34 - The changes made in Call to Action, will be reflected in the original action (from where the script is called) where as in Copy Action , the changes made in the script ,will not effect the original script(Action)

A - True

B - False

Answer : A

Explanation

Seat license is specific to a computer on which it is installed.

Q 35 - How can you remove a stored movie from the test result?

  1. Selecting File > Remove Movie from Results.

  2. Selecting Tools > Remove Movie from Results.

  3. Delete physical movie file from the result location.

  4. once recorded you can not remove the movie from test result.

A - (1) (2) and (3) only

B - (3) Only

C - (2) and(4) Only

D - All (1) (2) (3) and (4)

Answer : C

Explanation

To remove recorded movie from the test result, you can either select ‘Remove Movie from Results’ in File menu or you can delete the physical movie file at result location.

Q 36 - Which QuickTest operation can not be performed on a virtual object?

  1. cannot be used in expert view

  2. cannot insert a standard checkpoint

  3. cannot insert a image checkpoint

  4. cannot use object spy

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D - (2) (3) and (4)

Answer : D

Explanation

You cannot insert any type of checkpoint on a virtual object, or use the Object Spy to view its properties.

Q 37 - How can you create a .zip file of your test?

  1. File > Export Test to zip file

  2. File > Save as zip file

  3. File > Save Test with sources and select Archive test and resource files in a zip file check box

  4. CTRL+ALT+S

  5. you can not create a .zip file of the test.

A - (1) (3) and (4) only

B - (4) Only

C - (1) and(3) Only

D - All (1) (2) (3) and (4)

Answer : A

Explanation

UFT has a feature to export youur test to a zip file. you can do this by selecting ‘File >> Export Test to zip file’ (CTRL+ALT+S) menu options, or while saving the test with resources(File>Save Test with Resources) and select Archive test and resource files in a zip file check box.

Q 38 - Which of these Add-ins QTP currently supports to work with Extensibility?

  1. .Net

  2. Visual Basic

  3. Delphi

  4. Web

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D - (1) (3) and (4)

Answer : D

Explanation

Currently UFT supports Web, .Net, Java and Delphi Add-ins for Extensibility.

Q 39 - When you split an action in your test that uses a local repository, Quick Test makes a copy of the local object repository and if you add objects to one of the split actions, the new object are added only to the corresponding repository.

A - True

B - False

Answer : A

Explanation

Yes, When you split an action in your test that uses a local repository, Quick Test makes a copy of the local object repository and if you add objects to one of the split actions, the new object are added only to the corresponding repository.

Q 40 - Which is the best match for the regular expression for deer|dees

  1. deer

  2. deedess

  3. deerees

  4. dees

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(4) Only

D - All (1) (2) (3) and (4)

Answer : C

Explanation

'|' instructs UFT to match one of a choice of expressions.

Q 41 - When you use 'Object' Property of an object. What does it imply?

  1. you get a reference to the DOM object

  2. you can access the internal methods and properties of the object

  3. you can use an object that is not in Object Repository

  4. you can access the test object properties of an object from object repository

A - (1) and (2) only

B - (3) Only

C - (1) and(3) Only

D - All (1) (2) (3) and (4)

Answer : A

Explanation

Object property accesses the internal methods and properties also references to the DOM object.

Q 42 - We can use regular expression for urls in the list of Browsers under Tools > Options > Web to ignore them during record and replay time.

A - True

B - False

Answer : A

Explanation

We can use regular expression for urls in the list of browsers to ignore.

Q 43 - What type of environment variables can be added from Environment view under Test Settings?

A - Built-in and User-defined

B - Static and Dynamic

C - Only Built-in no User-defined

D - Only Static no Dynamic

Answer : A

Explanation

There are two types of environment variable – built-in and User-defined.

Q 44 - Instead of using File > Open Test to open an existing test, what other possible way(s) you can use to open an existing test?

  1. Select Test from the recent file list in the File menu

  2. Select Test from the recent file list in the start page

  3. dragging a test from windows explorer

  4. Selecting Right click in test editor and select Open Test

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D - All (1) (2) (3) and (4)

Answer : D

Explanation

ou can open a test by dragging it from windows explorer , also for a recent file used you can select the test from Recent file list.

Q 45 - If you drag-drop a function into your test, UFT removes that function from Available Keywords pane and inserts a call to the function in the test.

A - True

B - False

Answer : B

Explanation

UFT does not remove the function from Available keywords pane if you drag-drop any function to the test.

Q 46 - How do you synchronize your scripts in QTP ?

  1. Sync

  2. Exist

  3. WaitProperty

  4. Visible

A - (1) (2) and (3) only

B - (3) Only

C - (1) and(3) Only

D - All (1) (2) (3) and (4)

Answer : A

Explanation

You can synchronize script using Sync, Exist or using WaitProperty.

Q 47 - A comment in Expert view can begin with ... so that it can be seen at comments tab in To Do pane.

  1. 'To Do

  2. 'to-do

  3. 'todo

  4. only a single quote ( ' )

A - (1) (2) and (3) only

B - (3) Only

C - (1) (2) and (3) Only

D - All (1) (2) (3) and (4)

Answer : C

Explanation

You can view a comment in comments tab by adding To Do, todo or to-do after single quote.

Q 48 - Conditional statements cannot be inserted in Keyword view.

A - True

B - False

Answer : B

Explanation

You can insert conditional statements in keyword as well as expert view.

Q 49 - Input or Output action parameter name are not case sensitive.

A - True

B - False

Answer : B

Explanation

Input or output action parameter names are case sensitive.

Q 50 - Which is the best match for the regular expression for dee(r|d)ees

  1. deer

  2. deedees

  3. deerees

  4. dees

A - (1) (2) and (3) only

B - (2) and (3) Only

C - (1) and (4) Only

D - All (1) (2) (3) and (4)

Answer : B

Explanation

‘|’ instructs QTP to match one of a choice of expression, ‘(‘ groups the expression.

Answer Sheet

Question Number Answer Key
1 A
2 C
3 C
4 C
5 D
6 B
7 C
8 B
9 A
10 A
11 A
12 B
13 B
14 C
15 A
16 C
17 B
18 C
19 C
20 B
21 A
22 B
23 C
24 B
25 A
26 D
27 C
28 A
29 A
30 D
31 B
32 D
33 B
34 A
35 C
36 D
37 A
38 D
39 A
40 C
41 A
42 A
43 A
44 D
45 B
46 A
47 C
48 B
49 B
50 B
qtp_questions_answers.htm
Advertisements