- 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 IV
Q 1 - After registering a function to a test object using RegisterUserFunc, it is displayed as .... in Keyword view and Step Generator.
Answer : B
Explanation
After registering a function to a test object using RegisterUserFunc, it is displayed as Operation in Keyword view and Step Generator.
Q 2 - Where can you define or override default shortcut keys for editing?
Answer : B
Explanation
You can personalize the default keyboard shortcuts for editing at Tools > View options in key binding tab.
Q 3 - Which test object property is used to access native properties of a run-time object?
Answer : D
Explanation
Object property of an object can be used to access native properties of a run-time object.
Q 4 - When you set the path of your application at 'Record and Run Setting' to automatically open the application on recording, what is the statement that gets added in expert view for this step of opening application?
Answer : D
Explanation
When you specify an application to open using the Record and Run Settings dialog box, QuickTest does not add a SystemUtil.Run or any other statement to your test.
Q 5 - What is the default value for the 'Generate with statements for _____ or more objects' in General pane at Options dialog box ?
Answer : C
Explanation
Default value is 2 for the option 'Generate with statements'
Q 6 - What can be matched using (*) in a regular expression?
B - Zero or more specific characters
Answer : B
Explanation
Using asterisk(*) in regular expression indicates to match zero or more specific characters.
Q 7 - 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 : D
Explanation
You can specify a maximum of 32000 rows.
Answer : D
Explanation
Shortcut key for the standard checkpoint is F12.
Q 9 - 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.
Q 10 - Which of the following statements is correct for creating UFT application object?
A - qtCom = CreateObject(QuickTest.Application)
B - qtCom = CreateObject("QuickTest.Application")
Answer : D
Explanation
The correct servername.typename for QTP to open using createobject is QuickTest.Application.
Q 11 - What are the options available under Quality Center version Control menu list?
Check out, Undo Check out, Check In
Check Out, Check In, Version History
Check Out, Check In, Get Latest version
Baseline History, Version History
Verify Version, delete Version
Answer : C
Explanation
Options available under Quality Center control menu are – Check out, Check in, Undo Check out, Version History,Baseline History.
Q 12 - What is the syntax to import an excel sheet to Data table ?
A - DataTable.Import "location of .xls file","sheet in .xls file","sheet in data table"
B - DataTable.ImportSheet "location of .xls file","sheet in .xls file","sheet in data table"
C - DataTable.ImportSheet "location of .xls file","sheet in data table","sheet in .xls file"
D - DataTable.ImportSheet "location of .xls file","sheet in .xls file",1
Answer : B
Explanation
The correct syntax for importing a sheet is DataTable.ImportSheet “location of .xls file”,”sheet in .xls file”,”sheet in data table”
Q 13 - What does the following statement return? -
str = "QuickTestProfessional"
msgbox mid(str,instr(str,"P"),len(str))
Answer : B
Explanation
str = “QuickTestProfessional”.
Q 14 - Some of the properties of an object can be changed during runtime, which are known as Run time properties but some of them can not be changed, what do we call those?
Answer : C
Explanation
Object properties which does not change during run time are known as Test Object Properties.
Q 15 - Where can you see the TO and RO properties and methods of an object?
Answer : B
Explanation
TO and RO Properties for an object can be seen in Object spy.
Q 16 - There are two objects on a webpage with same description. How will you distinguish between these two objects?
Answer : C
Explanation
For more than one object with same description, you can define the index property for the description.
Answer : C
Explanation
You can export and import and object repository to an xml file.
Q 18 - What does Browser navigation timeout at Setting option imply?
A - sets the maximum time (in seconds) that UFT waits for a web page to load before running a step
B - sets the minimum time (in seconds) that UFT waits for a web page to load before running a step
C - sets the maximum time (in minutes) that UFT waits for a web page to load before running a step
D - sets the minimum time (in minutes) that UFT waits for a web page to load before running a step
Answer : A
Explanation
Browser Timeout setting instructs UFT to wait for the specified time to load a web page before running a step.
Q 19 - If you need to open a text file in your test to write some data, which object will you use?
Answer : C
Explanation
You can use Scripting.Filesystemobject to open a text file
Q 20 - Which environment variable can be used to determine the path of the folder in which the test is located?
Answer : B
Explanation
Environement varaible ‘TestDir’ is used to get the test location.
Q 21 - In case QTP is not able to identify an object, what could be the possible reasons for it?
A - UFT installation is corrupt
B - Test is using a non-reusable action
Answer : C
Explanation
If the required Add-ins for an object are not loaded, QTP may identify the object properly.
Q 22 - Which statement can be used to handle unexpected errors in your test?
Answer : C
Explanation
We can use ‘On error resume next’ in UFT script to handle unexpected errors.
Q 23 - What is the numeric value for a Pass step for Eventstatus while sending result using Reporter.ReportEvent
Answer : A
Explanation
value for micPass event status is 0
Q 24 - Selecting File > Print Preview, Displays the _________ as it will look when printed and enables you to modify the page setup.
Answer : A
Explanation
Print Preview displays the preview only for Keyword view.
Q 25 - Which toolbar contains pause button, to interrupt a run session?
Answer : B
Explanation
The pause button is contained in Debug toolbar.
Q 26 - How can you define a date as a constant?
B - Const sDate = "30-04-2014"
Answer : C
Explanation
A date constant must start and end with a # e.g. Const sDate = #30-04-2014#
Q 27 - How many times 'LearnQTP' will be Printed?
Dim x, y
For x = 0 to 5 step 2
For y = 5 to 0 step -1
print “LearnQTP”
Next
Next
Answer : B
Explanation
Executing the given statements will print 'LearnQTP' 18 times as outer for loop executes for 3 times(index variable incremented by 2) and inner loop by 6 times.
Q 28 - If not explicitly defined, a function procedure is ..... by Default
Answer : B
Explanation
By Default, a function created is Public.
Q 29 - Which of the following statements can be used to clear the errors occurred in earlier statements if any?
Answer : C
Explanation
Err.Clear statement is used to clear the errors occured earlier in the statements, if any.
Q 30 - Which objectRepositoryUtil method is used to add an object to the object repository?
Answer : C
Explanation
You can add an object to Object Repository using the ObjectRepositoryUtil method AddObject.
Q 31 - How many counters are getting displayed at system monitor tab in test result?
Answer : C
Explanation
System Monitor tab can display a maximum of 2 counters at a time.
Q 32 - How can you edit a read-only function library?
A - right click the function library file and uncheck read only field in file properties dialog box
B - uncheck 'open file in read-only mode' while opening
Answer : D
Explanation
There is an option to enable editing for read-only function library at File > Enable Editing.
Q 33 - Which one of these statements is correct about Shared Repository?
A - Shared repository is difficult to maintain and can be used in multiple tests
B - Share repository is easy to maintain and cannot be used in multiple tests
C - Shared repository is easy to maintain and can be used in multiple tests
D - Shared repository is easy to maintain and can be used in a single test only.
Answer : C
Explanation
A Shared Object Repository is easy to maintain and can be used in multiple tests.
Answer : A
Explanation
Index, Location and CreationTime.
Q 35 - What could be the value of Creation time for first opened browser?
Answer : A
Explanation
First opened browser has creation time value as 0.
Q 36 - What are the default mandatory properties for a WebImage object?
Answer : D
Explanation
Defualt mandatory properties for an WebImage Object are – alt, html tag and image type.
Q 37 - What does this statement imply?
parent.Childobjects(oDesc)
A - count of the number of objects in the parent item
B - collection of all objects in the parent item
Answer : B
Explanation
Childobjects returns the collection of child objects contained within the object.
Q 38 - When you export a captured movie to a file, the file is saved as ________ file.
Answer : C
Explanation
When you export a captured movie to a file, the file is saved as fbr file.
Q 39 - What are the Export format option available to export the test results?
B - Short, Detailed, User-defined xls
Answer : D
Explanation
The three export format available to export test results are – Short, Details and user-defined xsl.
Q 40 - What is the method of datatable which can be used to retrieve information from datatable?
Answer : A
Explanation
Datatable.Value retrives information from a datatable.
Q 41 - How can you set a list of recovery scenarios as default for all new tests?
A - ading all recovery files to dat folder of installation folder
B - Selecting Default Checkbox for the recoveries at Recovery pane of test setting
C - Selecting Set as Default button at Recovery pane of test setting
D - Selecting Set as Default button at Recovery Scenario manager
Answer : C
Explanation
List of recovery scenarios can be made by default all the tests by selecting ‘Set as Default’ button at Recovery pane of test setting.
Q 42 - If a list of recovery scenarios are made default for all new tests that you create. What happens if you make any changes to this list for a new test?
A - it affects the current test only
B - it affects all the existing tests
Answer : A
Explanation
If you make any changes to the default list of recovery scenarios, it affects the current test only where the changes have been made.
Q 43 - In update run mode, QuickTest saves the updated objects in _________ Repository
Answer : A
Explanation
UFT saves the updated objects in the local object repository.
Q 44 - After running a test which has been parameterized using Datatable, where can you view the actual values taken from the data table during Run session?
Answer : C
Explanation
Value set to or taken from a data table during run session can be viewed in Run Time Data table.
Q 45 - ExitAction(2) - What do you understand by this statement in your test?
A - UFT will wait for 2 seconds before exiting the action
B - The action will return the value 2 after exiting the action
C - this statement will be executed on 2nd iteration
D - There is something wrong in the statement an ExitAction statement can not be used this way.
Answer : B
Explanation
The argument 2 used in ExitAction statement is the return value of an action.
Q 46 - Which tool can be used to merge checkpoints and output objects from primary or secondary object repository into a shared object repository?
B - Object Repository Merge Tool
Answer : D
Explanation
There is no tool available to merge checkpoint or output objects.
Q 47 - How can you select multiple items in a multi-selection list?
Answer : D
Explanation
ExtendSelect method is used to select multiple item in multi-select list.
Answer : D
Explanation
Click method does not return anything.
Q 49 - What are the naming restrictions for a variable?
Must not begin with an alphabetic character.
Cannot contain an embedded period.
Must not exceed 255 character
Must be unique in the scope in which it is declared.
Cannot contain an underscore.
Answer : D
Explanation
A variable name must be unique and in the scope in which it is declared. it should not exceed 255 chars and also it should not contain an embedded period
Q 50 - Which statement(s) can be used to declare a variable explicitly?
Dim
ReDim
Static
protected
DECLARE
Answer : A
Explanation
A variable can be declared explicitly using Dim, ReDim, Private, Public
Q 51 - What is the role of lservc file in UFT?
A - Contains information about the license code
B - Contains information about server where scripts are placed
Answer : A
Explanation
Contains information about license code and can be found under C:\Program Files\Common Files\HP\License Manager\lservrc
Q 52 - Which third party tool should be installed on your machine to enable debugging in QTP scripts?
Answer : C
Explanation
MS Debugger should always be installed on a QTP machine to make use of debug feature
Q 53 - What "method" is used to send custom message to result window?
Answer : B
Explanation
Reporter is the object while ReportEvent is one of the methods of Reporter object.
Q 54 - Which of the following characters is an escape character in VB scripting i.e. it indicates that the adjacent special character is to be treated as a literal character?
Answer : B
Explanation
Backslash character is of utmost importance when you want to escape meta characters while using Regular expressions.
Q 55 - Which of the following datatable functions return the column name?
Answer : B
Explanation
getparametername return the column name.
Q 56 - Err object contains information about the run time error. Which one of the following is the default property for Err object?
Answer : C
Explanation
Err object has a total of 5 properties and 2 methods associated with it. Number is the default
Q 57 - Value is a default property of DataTable object. What does the number "1" indicate in the following statement? x = DataTable.Value ("Column", 1)
A - Data is called from the 1st row of DataTable
B - Data is called from the 1st column of DataTable
C - It is a sheet ID that identifies the sheet to be returned.
Answer : C
Explanation
It is a sheet ID that identifies the sheet to be returned.
Q 58 - A Test "DemoApp" has been set to run on row 1-9 in Test Settings Dialog Box.
The "Action call properties" for action "login" is set to "Run All Rows" and the "login" action datasheet has 6 rows in it. How may iteration will the test run if it has 20 rows in the global data sheet?
Answer : B
Explanation
Test Settings dialog box controls the global data sheet so it will run 9 rows of global data sheet while action call properties controls the local data sheet so it will run 6 rows. In all 9*6 iterations will run.
Q 59 - A Test "DemoApp" has been set to run on row 1-9 in Test Settings Dialog Box. The "Action call properties" for action "login" use the default configuration and the "login" action datasheet has 6 rows in it. How may iteration will the test run if it has 20 rows in the global data sheet?
Answer : D
Explanation
Test Settings dialog box controls the global data sheet so it will run 9 rows of global data sheet. By default action call properties runs for the first row in data table., so it will run 1 rows. In all 9*1 = 9 iterations will run.
Q 60 - What happens when you import data using the DataTable.ImportSheet function?
A - Data is overwritten when column headers in Excel and the data table match.
B - Sheet1 in the Excel file is always imported.
C - Data will be appended to the data table.
D - A new column is added to the data table when column headers in Excel and the data table match.
Answer : A
Explanation
Data is overwritten when column headers in Excel and the data table match.
Q 61 - When inserting a call to a reusable action, which two ways can the tester handle the data resources in that action?
Have the new action refer to a read-only copy of the data in the original action.
Have the action get an empty set of data resources.
Delete the data.
Store an editable copy of the data in the new action.
Have the new action refer with write permissions to the copy of the data in the original action.
Answer : D
Explanation
Have the new action refer to a read-only copy of the data in the original action and Store an editable copy of the data in the new action.
Q 62 - A test, EditShoppingCart, has a call to an external action, SaveCart. The owner of SaveCart needs to perform maintenance on it and has turned off its Reusable property. When testers open the EditShoppingCart test, how will they know that the SaveCart action is unavailable?
A - SaveCart is listed with an explanation in the Details column in the Missing Resources panel.
B - HP UFT pops up an informational message when EditShoppingCart is opened.
C - SaveCart is grayed out in the Test Flow panel.
D - SaveCart is grayed out in the External Actions list in the Resources panel.
Answer : B
Explanation
HP UFT pops up an informational message when EditShoppingCart is opened.
Q 63 - Which types of conflicts does the Objects Repositories Merge Tool detect?
A - same name different description, similar description
B - same name extra properties, different name same properties
Answer : A
Explanation
same name different description, similar description
Q 64 - What is one purpose of virtual objects?
A - to point to an object name that might be located in any object repository
B - to map an area of your application to a standard class
C - to utilize an object without pre-defining the object type
D - to point to an object that will be defined later, possibly by another tester
Answer : B
Explanation
Virtual objects are used to map an area of your application to a standard class
Q 65 - Which public toolkits are supported by the Web Add-in Extensibility feature? - (select 4)
ASP.NET AJAX
FOX
SUN JWDK
Motif
Google Web Toolkit
YahooUI
Dojo
COM.NET AJAX
Answer : A
Explanation
Web Extensibility features are available for ASP.NET AJAX,Google Web Toolkit, YahooUI ,Dojo
Q 66 - How does the HP QuickTest Professional Web Add-in Extensibility feature improve browser independent support?
B - It extends Web testing support to Google Chrome and its different versions.
C - It supports testing custom controls on different versions of Internet Explorer only.
D - It supports browser independent web testing by replacing the Web Add-in.
Answer : A
Explanation
It supports testing custom controls on both Internet Explorer and Firefox, and on different versions of these browsers.
Q 67 - What are prerequisites for using Log Tracking? (Select two.)
The log framework must include an UDP appender.
The log files must be placed in a test directory.
The test must support log tracking statements.
All the Optional Steps must be disabled.
The tested application must use Java or .NET log framework.
Answer : A
Explanation
The log framework must include an UDP appender and The tested application must use Java or .NET log framework.
Q 68 - You have created a Bitmap checkpoint and want to allow a certain degree of difference between a stored expected image and an image from the AUT and still consider it a PASS. Which checkpoint feature should you use?
Answer : A
Explanation
Bitmap checkpoints use RBG Tolerance.
Q 69 - What is the purpose of the GetROProperty method?
A - to retrieve a property value of a runtime object
B - to retrieve a property of a test object
Answer : A
Explanation
GETROPROPERTY - to retrieve a property value of a runtime object
Q 70 - How can you add or change recordable or non-recordable operations to your test? (Select three.)
Drag objects from the Available Keywords pane.
Drag objects from the data table or insert from a shared repository.
Change the operation in the Keyword View.
Drag objects from Available Keywords or from the Active Screen.
Use the Step Generator or insert through Keyword View.
Add an operation in the Recording Option Manager.
Answer : D
Explanation
Drag objects from the Available Keywords pane or change the operation in keyword view or use the step generator.
Q 71 - What is the purpose of the Visual Relation Identifier?
A - It allows identification of objects, based on mapping of the Object Hierarchy to the AUT.
B - It allows identification of objects, based on sorting of objects on the AUT in a specific order.
C - It allows identification of objects, based on mapping to specific default classes.
D - It allows identification of objects, based on their neighboring objects.
Answer : D
Explanation
It allows identification of objects, based on their neighboring objects.
Q 72 - How does HP UFT identify each object you record? (Select two.)
by class
by properties
by methods
by ID
by name
Answer : C
Explanation
UFT recognizes objects through class and properties
Q 73 - Place the methods for identifying an object in the order in which UFT would attempt to use them Assume they are all defined/enabled.
A - Visual Relation Identifiers, Description Properties, Smart identification and Ordinal Identifier
B - Description Properties, Visual Relation Identifiers, Smart identification, Ordinal Identifier
C - Smart identification, Ordinal Identifier, Visual Relation Identifiers and Description Properties
D - Visual Relation Identifiers , Smart identification, Ordinal Identifier, Description Properties
Answer : B
Explanation
Description Properties followed by VRI then by Smart identification and finally by ordinal identifier.
Q 74 - You have defined a global synchronization timeout of 30 seconds for your test. The synchronization point timeout for a button to become enabled is set to 30,000. During playback of the script, what is the maximum amount of time HP UFT will wait for the button to become enabled?
Answer : C
Explanation
Synchronization point timeout is in ms. Hence 30,000ms = 30s. UFT will wait for 30+30 = 60seconds.
Q 75 - In the test results, square brackets around a test object name indicate that the test object was dynamically created using which functions? (Select two.)
Child Objects method
Smart Identification
DynamicBuild method
Create method
Programmatic Description
Answer : D
Explanation
Child Objects method and Programmatic Description
Answer Sheet
Question Number | Answer Key |
---|---|
1 | B |
2 | B |
3 | D |
4 | D |
5 | C |
6 | B |
7 | D |
8 | D |
9 | A |
10 | D |
11 | C |
12 | B |
13 | B |
14 | C |
15 | B |
16 | C |
17 | C |
18 | A |
19 | C |
20 | B |
21 | C |
22 | C |
23 | A |
24 | A |
25 | B |
26 | C |
27 | B |
28 | B |
29 | C |
30 | C |
31 | C |
32 | D |
33 | C |
34 | A |
35 | A |
36 | D |
37 | B |
38 | C |
39 | D |
40 | A |
41 | C |
42 | A |
43 | A |
44 | C |
45 | B |
46 | D |
47 | D |
48 | D |
49 | D |
50 | A |
51 | A |
52 | C |
53 | B |
54 | B |
55 | B |
56 | C |
57 | C |
58 | B |
59 | D |
60 | A |
61 | D |
62 | B |
63 | A |
64 | B |
65 | A |
66 | A |
67 | A |
68 | A |
69 | A |
70 | D |
71 | D |
72 | C |
73 | B |
74 | C |
75 | D |
To Continue Learning Please Login
Login with Google