Skip to main content

QTP Interview Questions

QUESTION 1
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
Answer: C

QUESTION 2
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
Answer: D

QUESTION 3
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
Answer: B

QUESTION 4
What can you use to handle unpredictable testing exceptions?
A. A Do Loop
B. Recovery Scenario
C. IFHEN statement
D. Selectase statement
Answer: B

QUESTION 5
In which command can you associate a function library to a test?
A. Run Options
B. Test Settings
C. View Options
D. Function Definition Gen.





1. How many tabs are there in Test Settings (File->Settings) window
A) 5
B) 6
C) 7
D) 8

2. 'Browser navigation timeout' is in which tab of Test Settings (File->Settings) window?
A) Properties
B) Resources
C) Web
D) Web Settings

3. Identify the tabs in the Test Settings (File->Settings) window
A) Properties, Run, Resources, Parameters, Environment, Web, Recovery
B) Properties, Run, Resources, Parameters, Environment, Web Settings,Recovery
C) Properties, Run Options, Resources, Parameters, Environment, Web, Recovery
D) Properties, Run, Resources, Input Parameters, Environment, Web, Recovery

4. 'Generate Script' is in which tab of Test Settings (File->Settings) window
A) Properties
B) Resources
C) Web
D) Recovery

5. For each object and method in an Expert View statement, a corresponding row exists in the Keyword View.
A) True
B) False
C) There is some problem with the statement.
D) None of above

6. The following are the four main columns in the Keyword view
A) Item, Operation, Value, Comments
B) Item, Operation, Value, Documentation
C) Item, Operation, Property, Documentation
D) Number, Operation, Value, Documentation

7. You can work on one or several function libraries at the same time.
A) True
B) False

8. You can insert additional steps on the test objects captured in the Active screen after the recording session.
A) True
B) False

9. The Active Screen enables you to parameterize object values and insert checkpoints
A) True
B) False

10. A QTP user can increase or decrease the active screen information saved with the test.
A) True
B) False

Answers:
1. C

2. C
3. A
4. A
5. A
6. B
7. A
8. A
9. A
10.A



1.   The toolbar enables you to view the details of an individual action or the entire test flow is:
A. Testing toolbar
B. None of the above
C. Action toolbar
D. Test Pane

2. The key that is used to Start/End analog recording mode ?
A. F3
B. SHIFT+ALT+F3
C. CTRL+SHIFT+F3
D. F10

3. QuickTest supports virtual object for analog or low-level recording.
A. False
B. True

4. To use a specific property to identify your object, but that property is not listed in the properties list. Then how do you identify that object?
A. Add the specific property to the list
B. Use the Default property
C. Use some other property to identify your object

5. The checkpoint used to check the alt attribute exists for all relevant objects (such as images) is
A. Database CheckPoint
B. Accessibility checkpoint
C. Bitmap checkpoint
D. Standard checkpoint

6. Bitmap checkpoint is supported in VB environment.
A. True
B. False

7. Can we parameterize the checkpoints properties?
A. No
B. Yes

8. What is the shortcut key that is used for a Standard Checkpoint?
A. F12
B. F2
C. F10
D. F7

9. Can we change name of checkpoint?

A. No
B. Yes

10. To compare the values of the specified property during a run session with the values stored for the same test object property within the test.

A. Checkpoint
B. All the above
C. Output Value
D. Compare the object property

11. You will use which recording mode for an object not recognized by QuickTest?

A. Low-Level Recording Mode
B. Normal recording Mode
C. Analog Mode

12. The statement that calls the recorded analog file is:
A. RunAnalog
B. CallAnalog
C. ExecuteAnalog

13. An action can be called by other tests or actions is:

A. Call Action
B. Split Action
C. Reusable Action

14. You can replace the page in your Active Screen tab:
A. False
B. True

15. QuickTest adds a checkpoint statement in the Expert View as:

A. Check Checkpoint
B. Checkpoint

16. A Checkpoint checks that a text string is displayed within a defined area in a Windows application is:
A. Accessibility
B. Text Area
C. Standard
D. Text

17. In ACTIVE X environment, an ACCESSIBILITY checkpoint is supported?
A. No
B. Yes

18. Can we get the execution time for an action in a Test?

A. Yes
B. No

19. Can we add external library files in QTP?

1. No
2. Yes

20. The method used to get data from HTML Table is
A. GetData(Row,Col)
B. GetRowValue(Rowid,Colname)
C. GetCellData (Row,Col)

21. The Command used to insert the transactions in test is:

A. StartTransaction(Name), EndTransaction(Name)
B. Services.StartTransaction "Name", Services.EndTransaction "Name"
C. StartTransaction.services "Name, EndTransaction.services "Name"

22. A step in which one or more values are captured at a specific point in your test and stored for the duration of the run session is:

A. Output Value
B. Checkpoints
C. Active Screen

23. QuickTest can detects an application crash and activate a defined recovery scenario to continue the run session.
A. True
B. false

24. In Batch Test process, the test list are saved in file format as:
A. *.mtb
B. *.mts
C. *.mbt
D. *.mtr

25. The command used to invoke other application from QTP:
A. InvokeApplication
B. SystemUtil.Run
C. Run
D. Both b & c
E. Both a & b

26. The command used to retrieve data from excel sheet is

A. Set ab = Connection("srcfilepath ") , Set ws = ab.getdata(sheetid)
B. Set ab = CreateObject("srcfilepath ") , Set ws = ab.getsheet(sheetid)
C. Set ab = GetObject("srcfilepath") , Set ws = ab.worksheets(sheetid)

27. The method that explicitly activates the recovery scenario mechanism is:

A. recovery.activate
B. enable
C. recovery.enable
D. activate

28. The method used for sending information to the test results is:

A. Reporter.log()
B. Reporter.reportevent()
C. Reporter.msgbox()
D. Reporter.report()

29. To terminate an application that is not responding we use:

A. SystemUtil.terminate
B. SystemUtil.Stop
C. SystemUtil.CloseProcessByName

30. The recovery mechanism does not handle triggers that occur in the last step of a test:

A. false
B. True

31. We can add Test object methods, function calls into the Test using:

A. Function generator
B. Step generator
C. Object repository

32. The method that adds to the test while implementing synchronization is:
A. Synchronize
B. Wait
C. WaitProperty
D. Pause

33. The mechanism used to identify objects during run session is:

A. Recovery scenario
B. Smart identification
C. Handling object

34. Post-recovery test run options specifies:

A. how to continue the run session after QTP identify the event
B. errors while running
C. recovery scenario during a run session

35. The action that can be called multiple times by the test as well as by other tests is called:
A. non-reusable action
B. Reusable action
C. External action

36. The command used to connect with Database is:

A. Createobject(connectivity name)
B. dbconnect(connectivity name)
C. open(connectivity name)
D. None of the above

37. The method used to retrieve the folders is:

A. FileSystemObject.Getfolder()
B. FileSystemObject.selectfolder()
C. FileSystemObject.retrievefolder()

38. The method used to compare 2 XML files is:

A1. XMLfile1.compare(XMLfile2)
B. XMLcompare(file1,file2)
C. compare(XMLfile1,XMLfile2)

39. The QTP script files are stored in the extension of:

A. *.mts
B. *.usr
C. *.mtr
D. *.vbs

40. The method used to register the user-defined function with test object is:

A. setFunc()
B. RegisterUserFunc()
C. RegisterFunc()

41. The method used to open the specified URL in a browser is:
A. openURL()
B. navigateURL()
C. navigate()

42. The 3 Parameter types available in data driver is:
A. DataTable,Environment,Random number
B. DataTable,random number,unique
C. environment,string,numeric

43. The method added to the test while parameterizing is:

A. get Data (variable, dtGlobalSheet)
B. get DataTable(variable, dtGlobalSheet)
C. Set Data(variable, dtGlobalSheet)
D. Set DataTable(variable, dtGlobalSheet)

44. The length of the array can be get by the method:

A. length(array)
B. ubound(array)
C. count(array)

45. The method used to get the count value of list box or combo box is:

A. GetItemsCount
B. GetCount
C. GetItemCount

46. To retrieve the current the objects in your application during the run session:
A. GetVisibleText
B. GetROProperty
C. SetROProperty
D. GetTOProperty

47. The list of test objects and their properties and values are stored in the:

A. Object Repository
B. Object Identification

48. The method used to continue the test execution after getting run-time error is:

1. On Error Resume Next
2. On Error Raise Next
3. On Error Next

ANS: 

1) c
2) b
3) a
4) a
5) b
6) a
7) b
8) a
9) b
10) a
11) a
12) a
13) c
14) b
15) a
16) b
17) a
18) a
19) 2
20) c
21) a
22) b
23) a
24) a
25) e
26) b
27) a
28) b
29) c
30) b
31) b
32) c
33) b
34) a
35) b
36) b
37) a
38) c
39) a
40) b
41) c
42) a
43) d
44) b
45) b
46) b
47) a
48) 1








1) You cannot expand ...... actions from the test flow
view.
A) reusable
B) non-reusable
C) both A & B
D) None

2) You can associate shared object repositories with
...... actions simultaneously, using the Associate
Repositories dialog box
A) seven
B) Two
C) Three
D) Multiple

3) You can associate ....... object repositories with
an action, and the same object repository can be
associated with different actions as needed
A) Nine
B) Twenty one
C) as many as you need
D) Twelve

4) Sometimes you may want to call an action from
within an action. This is called .......
A) Reusability
B) Nesting
C) Sharing
D) None

5) If a reusable action is called more than once in a
test and you split the action into two independent
actions, each call to the action within the test will be
followed by a call to the new (reusable) action. If a
reusable action is called from another test, however,
...... it may cause the calling test to fail.
A) Nesting
B) Splitting
C) Reusing
D) Both A & C

6) You must use the ...... Action option in QuickTest
if you want to save an action under another name.
A) Resave
B) Rename
C) Reuse
D) Split

7) When you remove an external action, you remove all
calls and the action from the action list. The original
action is also affected.
A) True
B) False

8) You can also press ...... to open the Rename Action
dialog box
A) Shift + F2
B) Shift + F3
C) Shift + F4
D) Shift + F5

9) If you want to include one or more statements in
every new action in your test, you can create an ....
A) reusable action
B) split action
C) Function
D) action template

11) Only the file name ...... is recognized as an
action template
A) ActionTemplate.mst
B) Action_Template.mst
C) Action-Template.mst
D) ActionTemplates.mst

Answers:

1) a 2) d 3) c 4) b 5) b 6) b 7) b 8) a 9) d 11) a





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

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

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

4. What can you use to handle unpredictable testing exceptions?

A. A Do Loop
B. Recovery Scenario
C. IFHEN statement
D. Selectase statement

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

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

7. Where do you mark an action as reusable?

A. Action Settings
B. Action Properties
C. Action Run Settings
D. Action Call Properties

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

A. Local DataSheet
B. Global DataSheet
C. Run-time Data Table
D. Design-time Data Table


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

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

Answers:

1 2 3 4 5 6 7 8 9 10
C D B B B D B C C A


1)    You can import and export object repositories from
and to .... files.
A) XML
B) MTS
C) TSR
D) XLS

2) In general, the ....... object repository is
easiest to use when you are creating simple record and
run tests.
A) Shared
B) Local
C) Both
D) None

3) The Object Repository automation object model
enables you to manipulate QuickTest ....... object
repositories and their contents from outside of
QuickTest.
A) Shared
B) Local
C) Both
D) None

4) Before using the Object Repository automation
object model to manipulate shared object repository
stored in Quality Center, you must download the shared
object repository and save it to the file system.
A) True
B) False

5) SetTOProperty changes the property values used to
identify an object during the test run. It also effects
the values saved in the Object Repository for the
object.
A) True
B) False

6) After creating or editing an object repository XML
file, it is recommended to use the QuickTest
..........functionality to verify that your file
conforms to the QuickTest object repository schema.
A) Schema Verification
B) Schema Validation
C) XML Validation
D) XML Verification

7) To display the Comment in the Object Repository
dialog box, you must use the attribute name .........
A) miccommentproperty
B) commentproperty
C) mic_comment_property
D) None of above

8) ObjectRepositoryUtil Object Enables you to
manipulate .....object repository files from outside of
QuickTest Professional.
A) Shared
B) Local
C) Both
D) None

9) You can use the Object Repository Merge Tool to
merge objects from ......
A) two shared object repositories into a single shared
object repository.
B) the local object repository of one or more actions or
components into a shared object repository.
C) Both A & B
D) None

10) GetTOProperty method returns the value of a
specified property for a test object from the Object
Repository.
A) True
B) False

Answers:

1)a 2)b 3)a 4)a 5)b 6)b 7)a 8)c 9)c 10)a





1) The new Object Repository Comparison Tool is
accessible from the Object Repository Manager. You can
use this tool to identify the differences between
objects in ........
A) two specified shared object repository files.
B) a Shared and a Local object repository files.
C) either Shared or Local object repository files.
D) two specified Local object repository files.

2) You can use the objects and methods of the
QuickTest .................... to write scripts that
automatically manipulate object repositories, instead of
performing these operations manually using the Object
Repository Manager.
A) Automation object model
B) Object Repository automation object model
C) Object Repository model
D) Object Repository Script Object model

3) You must convert object repository files from
QuickTest Professional 8.2.1 or earlier to the current
format before you can use them in QuickTest Professional
9.0 or later. Which method lets you do so.
A) Conversion method
B) Converge method
C) Convert method
D) None

4) You open the Object Repository window for a
specific component by choosing ..........
A) Resources > Object Repository
B) Tools > Object Repository
C) File > Object Repository
D) Help > Object Repository

5) In QTP 9 or above, Test objects can be stored in
two types of object repositories—........
A) a shared object repository and a Per-Action object
repository.
B) a shared object repository and a local object
repository.
C) a shared object repository and a Action object
repository.
D) Both A & C

6) The Object Repository Manager enables you to open
...... shared object repositories and modify them as
needed
A) multiple
B) three
C) two
D) Seven

7) ........ Method Loads the specified object
repository.
A) Overload
B) Load
C) Both A & B
D) None

8) An object repository that is currently open by
another user is locked, is it possible to merge a locked
object repository.
A) Yes
B) No

9) You can manage the shared object repository
associations of a selected test using the ............
A) Associate Repositories dialog box
B) Object Repositories dialog box
C) Associate Repositories Manager dialog box
D) Object Repositories Manager dialog box

10) All changes you make to an object repository are
automatically updated in all components open on the same
computer that use the object repository as soon as you
make the change—even if you have not yet saved the
object repository with your changes.
A) True
B) False

11) If you want to modify an object stored in a shared
object repository, you can modify it.......
A) using the Object Repository Manager
B) you can modify it locally using the Object Repository
window.
C) Both A & B
D) None of above

12) ................ Returns an ObjectRepositories
collection representing all object repository files
associated with the action.
A) Object Property
B) Automation Object Model
C) ObjectRepositories Property
D) OR PropertyAnswers

Answers:

1) a 2) b 3) c 4) a 5) b 6) a 7) b 8) a 9) a 10) a 11) c 12)c




91) An ........ assigns a numerical value to a test object that indicates its order or location relative to other objects with an otherwise identical description (objects that have the same values for all properties)
A) Index identifier.
B) ordinal identifier.
C) SMART ID identifier.
D) original identifier.
92) You can add an object to the local object repository only if that object does not already exist in a shared object repository that is associated with the action. If an object already exists in an associated shared object repository, you can add it to the local object repository using the ........ option.
A) Copy from Shared Repository
B) Copy from Shared Object Repository
C) Copy to Local
D) Copy to Local repository
93) You can copy, paste, and move objects in the local object repository using the Object Repository window, and copy, paste, and move objects both within a shared object repository and between shared object repositories using the Object Repository Manager. But you cannot copy objects from a shared object repository to the local object repository to modify them locally
A) True
B) False
94) At the time of copying, pasting and moving objects, you cannot move an object to any of its descendants.
A) True
B) False
95) When you remove a step from your test, its corresponding object is also removed from the object repository
A) True
B) False
96) You can use the Find and Replace dialog box to replace property or object names.

A) True
B) False
97) The Object Repository window is ...... during record and run sessions
A) read-only
B) read-write only
C) read-write and enable
D) None of above
98) In the Associated Repositories tab of the Action Properties dialog box, the ......object repository is always listed first and cannot be moved down the priority list or deleted.
A) local
B) shared
C) Both
D) None
99) In the Associated Repositories tab of the Action Properties dialog box, although we can order the object repositories according to our choice except the fact that Shared Repository remains the first one and cannot be removed.
A) True
B) False
100) If your object repositories are stored in the file system and you want other users or Mercury products to be able to run this action on other computers, you should set the file path as a
A) Absolute path
B) relative path
C) both
D) None of above

Answers

91) B, 92) C, 93) B, 94) A, 95) B, 96) B, 97) A, 98) A, 99) B, 100) B

Comments

Popular posts from this blog

Convert JSON to XML using QTP/UFT/VBScript

Sample Code : Dim strPage,strJSON,objIE strPage = "C:\Jay\JLoader.html" Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible = True objIE.Navigate2 strPage While objIE.Busy : Wend strJSON = "{""FirstName"":""Jay"", ""LastName"":""Krishna""}" Set objWin = objIE.document.parentWindow objWin.execScript "var jsonStr2XML = function(strJSON) { return json2xml(JSON.parse(strJSON));};" Msgbox  oWin.jsonStr2XML(strJSON) objIE.Quit In Detail: Converting The most popular data interchange format JSON(JavaScript Object Notation) to XML using QTP/UFT. Parsing JSON in UFT could be a challenge so we will use JavaScript in UFT to make it perfect. SO We need :              Java Script API  - To Convert JSON to XML                         JavaScript Files :                         http://goessner.net/download/prj/jsonxml/j

Read Outlook mail attachment and Body using Vb Script or QTP

Set olApp = CreateObject("Outlook.Application") Set olns = olApp.GetNameSpace("MAPI") Set ObjFolder = olns.GetDefaultFolder(6) j = 0 For each item1 in ObjFolder.Items        iattachCnt = item1.Attachments.Count     Print "Attachments Count: " & iattachCnt     For i = 1 to iattachCnt         Print "FileName :    " & item1.Attachments(i).FileName         Print "Display Name:   " & item1.Attachments(i).DisplayName         Print "Size: " & item1.Attachments(i).Size     Next     Print " Body : " & item1.body     Print "--------------------------------------Mail Num - " & j & " -----------------------------------------------"     j = j+1    Next

Excel Sorting By Rows and Columns

Excel Sorting By Row: Const xlAscending = 1 Const xlNo = 2 Const xlSortRows = 2 Set objExcel = CreateObject(“Excel.Application”) objExcel.Visible = True Set objWorkbook = objExcel.Workbooks.Open(“C:\Jay\Docs1.xls”) Set objWorksheet = objWorkbook.Worksheets(1) objWorksheet.Cells(1,1).activate Set objRange = objExcel.ActiveCell.EntireRow objRange.Sort objRange, xlAscending, , , , , , xlNo, , , xlSortRows set objExcel=nothing Excel Sorting By Column : Const xlAscending = 1′represents the sorting type 1 for Ascending 2 for Desc Const xlYes = 1 Set objExcel = CreateObject(“Excel.Application”)’Create the excel object objExcel.Visible = True’Make excel visible Set objWorkbook = _ objExcel.Workbooks.Open(“C:\Jay\Docs1.xls”)’Open the document Set objWorksheet = objWorkbook.Worksheets(1)’select the sheet based on the index .. 1,2 ,3 … Set objRange = objWorksheet.UsedRange’which select the range of the cells has some data other than blank Set objRange2 = objExcel.Range

How to Read or Select Context Menu or Right Click Menu using QTP.

Select The Item in Right Click Menu or Context Menu: Window("sampleWindow").WinMenu("MenuObjType:=1).Select"File;New" Here MenuObjtype can be 1 r 2 r 3 .......n Check wether the Item is Exist or Not: If Window("sampleWindow").WinMenu("MenuObjType:=1).GetItemProperty("1","Exist") Then   Msgbox"Exist" Else  Msgbox"Does Not Exist" End If                                         Or If Window("sampleWindow").WinMenu("MenuObjType:=1).GetItemProperty("File","Exist") Then   Msgbox"Exist" Else  Msgbox"Does Not Exist" End If Get the Items in Context Menu: For i = 1 to 10 Print  Window("sampleWindow").WinMenu("MenuObjType:=" & i).GetItemProperty("1","Label") Then Next

How to Download a file using VbScript

Following is the code to download a file using Vbscript, without using QTP This code uses the HTMLDom and URLDownloadToFile method from urlmon API. Since VBScript does support calling Native API methods directly, here I am using  Excel macro to declare a function for the urlmon API and running the macro by Excel API from VBscript Step1: Create a new excel and open the visual basic editor, Insert Module and paste the following code the Module, save the excel file Private Declare Function URLDownloadToFile Lib “urlmon” Alias _                                            “URLDownloadToFileA” ( _                                            ByVal pCaller As Long, ByVal szURL As String, _                                            ByVal szFileName As String, _                                            ByVal dwReserved As Long, _                                            ByVal lpfnCB As Long) As Long Sub FileSave(strUrl, Des)     r = URLDownloadToFile(0, strUrl, Des, 0, a)