QTP Multiple choice Questions and Answers

Posted On:January 28, 2019, Posted By: Latest Interview Questions, Views: 2812, Rating :

Best QTP Multiple choice Questions and Answers

Dear Readers, Welcome to QTP Objective Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of QTP MCQs. These objective type QTP questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular question during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.

1) Identify the recording mode, by which you can record the non-standard object in QTP

A) Standard recording

B) Analog recording

C) Low level recording

D) None

Ans: B

mcqs on QTP

2) By default, how many no of tables would be there in a script?

a) One

b) Two

c) Three

d) Four

Ans: B

 

3) By default, how many no of actions would be there in a script?

a) One

b) Two

c) Three

d) Four

Ans: A

 

4) The file extension of Local object repository file is

a) .MTR

b) .TSR

c) .QRS

d) None

Ans: A

 

5) The file extension of Shared object repository file is

a. .MTR

b. .TSR

c. .QRS

d. None

Ans: B

 

6) When a procedure is created in the Function Library editor, what is the extension of the file?

A. .INI

B. .TXT

C. .QFL

D. .VBS

Ans: C

 

7) In which command can you associate a function library to a test?

A. Run Options

B. Test Settings

C. View Options

D. Function Definition Generator

Ans: B

 

8) To invoke the function which does not return any value, we can use

a. call function name

b. function name

c. Both A & B

d. None

Ans: A

 

9) The result of the checkpoints can be stored in a variable

a. True

b. False

Ans: A

 

10) Parameterization generally involves

a. Data table

b. Random number

c. Environment

d. Both A & B

e. Both A, B & C

Ans: E

 

11) The file which is used for recovering from the run time errors known as

A. QRS

B. TSR

C. PNG

D. DAT

Ans: A

 

12) Among the following recording modes, which method uses both the objects and mouse coordinates

a. Normal

b. Low level

c. Analog

d. All of the above

Ans: B

 

13) Where do you set the action iterations for a specified action?

a. Action Settings

b. Action Properties

c. Action Run Properties

d. Action Call Properties

Ans: D

 

14) Where do you mark an action as reusable?

a. Action Settings

b. Action Properties

c. Action Run Properties

d. Action Call Properties

Ans: B

 

15) After running a test that contains both input and output parameters, where can the results of an output parameter be found?

a. Local Data Sheet

b. Global Data Sheet

c. Run-time Data Table

d. Design-time Data Table

Ans: C

 

16) If you have a Virtual Object Collection stored on your machine, and you don’t want to use it what you must do?

a. Disable Virtual Objects in Test Settings

b. Remove the Collection from your machine

c. Disable Virtual Objects in General Options

d. Remove the Collections from the Resources list

Ans: C

 

17) Which method for the Data Table utility object will allow you to retrieve information from the Data Table during a test run?

a. Value

b. Import

c. GetCell

d. GetValue

Ans: A

 

18) Statement to return the value from the function

A. Return (return value)

B. Exit (Return value)

C. Function name = Return value

D. None

Ans: C

 

19) constant “2” with the reporter statement returns

a. Pass

b. Fail

c. Done

d. Warning

Ans: C

 

20) The standard timing delay for windows application is

A. 20 seconds

B. 60 seconds

C. Infinite

D. 100 seconds

Ans: A

 

21) The standard timing delay for web based application is

A. 20 seconds

B. 60 seconds

C. Infinite

D. 100 seconds

Ans: B

 

22) In VB Script functions, which one is false among the following

a. Variables must be declared before use

b. Variables may not be declared before use

c. Variables may be declared without data types

d. None

Ans: A

 

23) To count the no of rows in a table

a. getrowcount

b. Getlinecount

c. Getcount

d. Count

Ans: A

 

24) Object which is used for calling the win32 api functions in QTP, we use

A. extern

B. description

C. environment

D. None

Ans: A

 

25) By default, the all actions in QTP are

a. non – reusable

b. reusable

c. external

d. None

Ans: A

 

26) To refer the global data sheet, we can use the statement

a. dtglobalsheet

b. Global

c. Both A & B

d. None

Ans: C

 

27) Select Case statement is end with

A. end case

B. exit case

C. esac

D. end select

Ans: D

 

28) To specify the “Not Equal to” in QTP, symbol used is

A. !=

B. <>

C. NOT =

D. ==

Ans: B

 

29) which one is the default data type of QTP

A. integer

B. String

C. Variant

D. Double

Ans: B

 

30) To differentiate similar objects in one screen, QTP uses

A. object identification

B. Smart identification

C. Object repository

D. Object spy

Ans: B

 

31) To use the non-standard windows object, we can go for

A. Object spy

B. Virtual objects

C. Object identification

D. None

Ans: B

 

32) To use the constant timing delay between process, QTP uses,

a. wait

b. pause

c. Synchronization point

d. None

Ans: A

 

33) To terminate the script execution, during running, QTP uses

a. Exit run

b. Stop run

c. Quit

d. None

Ans: A

 

34) We can access the objects of the application without using object repository.

a. True

b. False

Ans: A

 

35) Checkpoints statements can be manually added to the script without using menus.

a. True

b. False

Ans: B

 

36) while statement always end with

a. end while

b. End do

c. Wend

d. Loop

Ans: C

 

37) Do statement always end with

a. end while

b. End do

c. Wend

d. Loop

Ans: D

 

38) Utility to measure the timing delays between transactions, we use

a. synchronization

b. sync

c. services

d. wait

Ans: C

 

39) If the same object is present in the local and shared repository, QTP will refer which one?

a. shared

b. Local

c. Both A & B

d. None

Ans: C

 

40) The default addins with QTP are

a. Active X

b. Visual Basic

c. Web

d. All of the above

Ans: D

 

41) Which one is not true about “Copy of action”

a. Tester can edit the script

b. Tester can’t edit the script

c. Tester can view the script

d. None

Ans: B

 

42) Which one is not true about “Call of action”

A. Tester can edit the script

B. Tester can’t edit the script

C. Tester can view the script

D. None

Ans: A

 

43) Which one is true about “Do” statement

A. End with “Loop while false”

B. End with “Until True”

C. End with “Wend”

D. Both A and B

Ans: D

 

44) Checkpoint which is being used for verifying the web page with W3C standard is

A. Bitmap checkpoint

B. Standard checkpoint

C. Accessibility checkpoint

D. XML checkpoint

Ans: C

 

45) Planning for the no of iteration for the action is done at

A. Action properties

B. Action call properties

C. Call to existing action

D. None

Ans: C

 

46) To enter the non-executable statement in QTP , we use

A. single quotes

B. Rem

C. Both A and B

D. None.

Ans: A

 

47) To invoke the function which does not return any value, we can use

A. CALL function name 

B. function name 

C. Both A & B 

D. None 

Ans: A

 

48) The standard timing delay for web based application is

A. 20 seconds 

B. 60 seconds 

C. Infinite 

D. 100 seconds 

Ans: B

 

49) What are the steps involved in building a programmatic description of dynamic objects?

 A.  1. Identify the object class. 2. Select object properties. 3. Create a programmatic description. 

 B.  1. Select object properties. 2. Identify the object class. 3. Create a programmatic description. 

C.   1 Create a programmatic description. 2. Select object properties. 3. Identify the object class. 

Ans: A

 

50) Is the function of the “IS” operator to compare two objects ?

A. YES 

B. NO 

Ans: A

 

51) Select the VBScript function that invoke message boxes for interaction with user :-

A. MessageBox 

B. InputBox 

C. OutputBox 

D. DisplayDialog

Ans: B

 

52) Does a sub-routine always return a value ?

A. YES 

B. NO 

Ans: B

 

53) Can you select multiple trigger scenarios for a recovery event ?

A. YES 

B. NO 

Ans: A

 

54) Test Scripts using Descriptive Programming are highly portable ( can be easily run on different machines ) ?

A. YES 

B. NO

Ans: A

 

55) What are BooksMarks in QTP 10 ?

A. Repository of commonly used Test Scripts 

B. Repository of commonly used Test Data 

C. Repository of commonly used Test Results 

D. User – defined library of important section in function or script 

Ans: D

 

56) VBScript Runtime Error number 507 is

A. An exception occurred 

B. Argument not optional 

C. Division by zero 

D. Error in loading DLL 

Ans: A

 

57) Silent Test Runner utility is used to run QTP Script

A. Without QTP interface 

B. Without the Application Under Test Interface 

C. Without Network and Mouse movement delay 

Ans: A

 

58) Is SetSecure Method is used to encrypt passwords ?

A. YES 

B. NO 

Ans: A

 

59) Is Action Conversion Tool used to convert Actions prepared in QTP to Business Components ?

A. YES 

B. NO 

Ans: A

 

60) Which of the following statements can create a branching condition step in a test?

A. While…Wend 

B. If…Else 

C. For…Next 

D. Do…Until 

Ans: B

 

61) You would like to run a particular test up to a certain step. What QuickTest feature will you use to stop the test run at a specific step in the test?

A. Pause 

B. Step Into 

C. Step Over 

D. Breakpoint 

Ans: D

 

62) When a procedure is created in the Function Library editor, what is the extension on the file?

A. .INI 

B. .TXT 

C. .QFL 

D. .VBS 

Ans: C

 

63) What are the categories in the Step Generator?

A. Object, Operation, Value 

B. Library, Built-in, Local Script 

C. Operation, Arguments, Return Value 

D. Test Objects, Utility Objects, Functions 

Ans: D 

 

64) In Test Settings ->Run the Data Table iteration options are for which data sheet?

A. Local 

B. Global 

C. Run-time Data Table 

D. Design-time Data Table 

Ans: B

 

65) What can you use to handle unpredictable testing exceptions?

A. Do Loop 

B. Recovery Scenario 

C. IF THEN statement 

D. Select case statement 

Ans: B

 

66) Where can you associate a function library to a test?

A. Run Options 

B. Test Settings 

C. View Options 

D. Function Definition Generator 

Ans: B

 

67) Where do you set the action iterations for a specified action?

A. Action Settings 

B. Action Properties 

C. Action Run Settings 

D. Action Call Properties 

Ans: D

 

68) If you have a Virtual Object Collection stored on your machine, and you don't want to use it, what must you do?

A. Disable Virtual Objects in Test Settings 

B. Remove the Collection from your machine 

C. Disable Virtual Objects in General Options 

D. Remove the Collections from the Resources list 

Ans: C

 

69) Which method for the DataTable utility object will allow you to retrieve information from the Data Table during a test run?

A. Value 

B. Import 

C. GetCell 

D. GetValue 

Ans: A

 

70) What does the source property of a database checkpoint object represent?

A. The SQL query 

B. The identification number of the database 

C. The number of rows returned from the query 

D. The connection string used to connect to the database 

Ans: A

 

71) What is created, by default, with each new action?

A. Local Data Sheet, Global Data Sheet, Folder 

B. Local Object Repository, Local Data Sheet, Folder 

C. Global Data Sheet, Local Object Repository, Folder 

D. Local Data Sheet, Global Data Sheet, Local Object Repository

Ans: B

 

72) What are the available environment variable type(s)?

A. Built-in 

B. User-defined 

C. User-function 

D. Built-in, User-defined 

Ans: D

 

73) If the Global Data sheet contains no data and the Local Datasheet contains two rows of data, how many times will the test iterate?

A.

B.

C.

D.

Ans: A

 

74) What is the first thing that must be defined in a Recovery Scenario?

A. Trigger 

B. Recovery Operation 

C. Recovery Scenario Name 

D. The Function used in the scenario 

Ans:  A

 

75) What are bitmap checkpoints sensitive to?

A. Image size and object type 

B. Object type and image type 

C. Screen resolution and object type 

D. Screen resolution and image size 

Ans: D

 

76) To use low-level recording, what must you do first?

A. Start a new test 

B. Be in the Keyword view 

C. Be recording in Normal mode 

D. Click Low Level Recoding under the Automation Menu 

Ans: C

 

77) How do you close the database session after examining the results of an SQL query?

A. Call the ADO.Close function 

B. Use the close method for the RecordSet object 

C. Set the RecordSet and Connection objects equal to Nothing 

D. Use the close method for the RecordSet and Connection objects 

Ans: D

 

78) What are the available trigger event types?

A. Pop-up window, object state, VBScript event 

B. Object State, VBScript event, Application crash 

C. Pop-up window, object state, test run error, QTP crash 

D. Pop-up window, object state, test run error, application crash 

Ans: D

 

79) What are the two most commonly used ADO objects?

A. Fields 

B. Execute 

C. Connection, RecordSet 

D. Open, ConnectionString 

Ans: C

 

80) What does the GetTOProperty method do?

A. Retrieves the value of a property from a test object 

B. Retrieves the available properties from a test object 

C. Retrieves the value of a property from a run-time object 

D. Retrieves the available properties from a run-time object

Ans: A

 

81) Checkpoint which is being used for verifying the web page with W3C standard is

A. Bitmap checkpoint 

B. Standard checkpoint 

C. Accessibility checkpoint 

D. XML checkpoint 

Ans: C

 

82) How do you declare a constant?

A. Dim statement 

B. Con statement 

C. Const statement 

D. Option Explicit statement 

Ans: A

 

83) Can a single test script have multiple Recover Scenarios?

A.  YES 

B.  NO 

Ans: A

 

84) Is Reporter.ReportEvent Library Function is used to display images in test results ?

A.  YES 

B.  NO 

Ans: A

 

85) Can User-Defined Environment Variables be used outside the QTP Environment ?

A.  YES 

B.  NO 

Ans: B

 

86) Will Test Results be automatically be stored in Quality Center (QC) if we run the test script from QC

A.  YES 

B.  NO 

Ans: A

 

87) Can QTP be integrated with Test Director (TD)?

A.  YES 

B.  NO 

Ans: A

 

88) Select the tools that can NOT be integrated with QTP :-

A.  Quality Center 

B.  Winrunner 

C.  Silk Runner 

D.  Test Director 

Ans: C

 

89) Select valid syntax of CallFuncEx command

A.  CallFuncEx ModulePath, Function, RunMinimized, CloseApp [ , Arguments ] 

B.  CallFuncEx Function, ModulePath, RunMinimized, CloseApp [ , Arguments ] 

C.  CallFuncEx ModulePath, Function, CloseApp [ , Arguments ] ,RunMinimized 

D.  CallFuncEx Function ,ModulePath, CloseApp [ , Arguments ] , RunMinimized 

Ans: A

 

90) Can multiple instances/processes/sessions/windows of QTP be run at the same time?

A.  YES 

B.  NO 

Ans: B

 

91) Can QTP run on multiple instances/processes/sessions/windows of Application under Test?

A.  YES 

B.  NO 

Ans:  B 

 

92) Select the Invalid syntax to access data in Data Table via VB Scripting :-

A.  DataTable(“Column Name”, dtGlobalSheet) 

B.  DataTable(“Column Name”, dtLocalSheet) 

C.  DataTable(Column ID, Sheet ID) 

D.  DataTable(Column Name, Sheet ID) 

Ans: D

 

93) Consider following piece of code  

on error resume next

val=DataTable("ParamName",dtGlobalSheet)

if err.number 1 then

'Parameter does not exist

else

'Parameter exists

end if

Code highlighted above is not logically correct. Select the correct code from the options Provided

A.  if err.number 2 then 

B.  if err.number val then 

C.  if err.number “ParamName” then 

D.  if err.number 0 then 

Ans: D

 

94) Does SetTOProperty change the property of an object stored in the Object Repository such that, next time the object is referred to in the test script the updated property of the object is used?

A.  Yes 

B.  No 

Ans: B

 

95) Select the function used to set property of a run – time object :-

A.  SetTOProperty 

B.  GetToProperty 

C.  SetRoProperty 

D.  Cannot be set 

Ans: D

 

96) Does GetROProperty return the property of a run-time object?

A.  Yes 

B.  No 

Ans: A

 

97) Object Spy is used to check :-

A.  Test-Time Properties of an Object 

B.  Test-time Properties and Test-Time Methods of an Object 

C.  Run-time Properties and Run –Time Methods of an Object 

D.  Test - time and Run-time Object Properties and Test-time and Run – time Object Methods 

Ans: D

 

98) Can Descriptive Programming be used to create Test Scripts for an application without actually recording on it ?

A.  Yes 

b.  No 

Ans: A

 

99) Consider following line of code :-

StartURL = "http://www.yahoo.com"

Set IE = CreateObject("InternetExplorer ")

IE.Visible = True

IE.Navigate StartURL

Set IE = Nothing

The highlighted line of code is not syntactically correct. Select the correct line of code

A. Set IE = CreateObject('InternetExplorer.Shell') 

B. Set IE = CreateObject('InternetExplorer.Run') 

C.  Set IE = CreateObject('InternetExplorer.Application') 

D.  Set IE = CreateObject('InternetExplorer.Script')

Ans: C 

 

100) Select the syntactically correct lines of codes :-

A.  Browser(creationtime=4).Page(title=Editorial CompanySearch).Link(text=Codes). 

B.  Browser(creationtime:=4).Page(title:=Editorial CompanySearch).Link(text:=Codes). 

C.  Browser('creationtime:=4').Page('title:=Editorial CompanySearch').Link('text:=Codes').Click 

D.  Browser('creationtime=4').Page('title=Editorial CompanySearch').Link('text=Codes').Click 

Ans: C