Tuesday, February 28, 2012

QTP Certification Test Series 1

1) 'Browser navigation timeout' is in which tab of Test

Settings (File->Settings) window.



A) Properties

B) Resources

C) Web

D) Web Settings



2) How many tabs are there in Test Settings

(File->Settings) window



A) 7

B) 6

C) 5

D) 8



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) Web

C) Resources

D) Recovery



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



6) 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 a problem with the statement.

D) None of above



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) A, 3) A, 4) A, 5) b, 6) A, 7) A, 8) A, 9) A,

10) A




QTP Certification Test series 2


1) The Information pane provides a list of.............

in the test:

A) Semantic errors

B) Syntax errors

C) Common errors

D) Logic errors



2) When we switch from Expert view to the Keyword view,

QTP automatically checks for syntax errors in the test

and shows them in the information pane.



A) True

B) False



3) If the information pane is not open, QTP

automatically opens it in case a syntax error is

detected.

A) True

B) False



4) ..................... provides a list of the

resources that are specified in your test but cannot be

found.

A) Missing pane

B) Missing Resources pane

C) Resources pane

D) Missing Items pane

5) Whenever you open a test or a function library, QTP

automatically checks for the availiblity of specified

resources.

A) True

B) False



6) The Data Table does not assists you in

parameterizing your test.

A) True

B) False



7) Tabs in the Debug Viewer pane are:



A) Watch, Variables, Debug

B) Watch, Data, Command

C) Watch, Variables, Command

D) View, Variables, Command



8) ............... tab enables you to view the current

value of any variable or VBScript expression.



A) Watch

B) VIew

C) Locate

D) Current

9) The .... tab displays the current value of all

variables that have been recognized up to the last step

performed in the run session.

A) View

B)Variables

C) Locate

D) Current

10) The .........tab enables you to run a line of script

to set or modify the current value of a variable or

VBScript object in your test or function library.



A) View

B) Variables

C) Command

D) Current



Answers

1) B, 2) A, 3) A, 4) B, 5) A, 6) B, 7) C, 8) A,

9) B, 10) C


QTP Certification Test Series 3

1) Panes in QTP can have one of the following


states—docked or floating.



A) True

B) False

2) Which of the following statement is True:



A) QuickTest enables you to open and work on one test at

a time

B) QuickTest enables you to open and work on two tests

at a time

C) QuickTest enables you to open and work on predefined

number of tests at a time

D) QuickTest enables you to open and work on nine test

at a time



3) Which of the following statement is True:



A) You can open and work on two function libraries

simultaneously

B) You can open and work on multiple function libraries

simultaneously

C) You can open and work on nine function libraries

simultaneously

D) You can open and work on one function library at a

time



4) You can open any function library, regardless of

whether it is associated with the currently open test.



A) True

B) False



5) You can work with multiple documents (test,

component, or application area, function libraries)

using the...... dialog box



A) Panes

B) Display

C) Show

D) Windows



6) QuickTest has ..... built-in toolbars.



A) 5

B) 6

C) 7

D) 8



7) The ......... toolbar contains buttons for recording

and running your test.



A) Standard

B) Tools

C) Automation

D) Edit



8) Shortcut Key for opening a new Function Library is:



A) Shift+Alt+N

B) Ctrl+Alt+N

C) Shift+N

D) CRTL+N



9) Shortcut Key for Closing all open Function Libraries

in one go.



A) Ctrl+Alt+C

B) Shift+A+C

B)Shift+N

D) None of these



10) shortcut Key for Commenting out the current row, or

selected rows



A) Shift+M

B) Ctrl+C

C) Ctrl+M

D) Shift+C



Answers



1) A, 2) A, 3) B, 4) A, 5) D, 6) D, 7) C, 8) A,

9) D, 10) C

QTP Certification Test Series 4

1) You can manage the test actions and the test or

function library steps using the ... menu commands



A) File

B) Edit

C) Automation

D) Tools



2) To expand all the steps in the keyword view which

option you would use from the View menu.

A) Expand

B) Expand All

C) Expand Items

D) Expand Rows



3) What is the shortcut key to open a Step Generator.



A) F2

B) F5

C) F6

D) F7

4) Function Definition Generator in found in which menu

option.



A) File

B) Tools

C) Insert

D) View

5) The shortcut keys for Record, Stop and Run

respectively are

A) F3, F4, F5

B) F4, F3, F5

C) F4, F5, F3

D) F3, F5, F4

6) What is the shortcut key for opening an Object

Repository.

A) Alt+R

B) Shift+R

C) Ctrl+R

D) Shift+O+R



7) Shortcut key to Insert/Remove a breakpoint is

A) F9

B) F8

C) Ctrl+b

D) Shift+b



8) .........runs only the current line of the script.

If the current line calls a method, the method is

displayed in the view but is not performed.

A) Step Over

B) Step Out

C) Step Into

D) Step Till

9) .........runs only the current line of the script.

When the current line calls a method, the method is

performed in its entirety, but is not displayed in the

view.

A) Step Over

B) Step Out

C) Step Into

D) Step Till

10) What is the shortcut key to Clear all Breakpoints

A) Ctrl+Shift+F9

B) Shift+Ctrl+F9

C) Alt+Shift+F9

D) Alt+Ctrl+F9



Answers



1) B, 2) B, 3) D, 4) C, 5) A, 6) C, 7) A,8) C,

9) A, 10) A




QTP Certification Test Series 5

1) Object Spy can be found in ........menu.



A) Tool

B) Tools

C) Task

D) Tasks



2) ............ displays the open documents

side-by-side.



A) Tile Vertically

B) Tile Horizontally

C) Cascade

D) Tile Cascade



3) For opening the QuickTest Professional Help we can

use.......



A) F3

B) F5

C) F1

D) F2



4) If QTP cannot find any object that matches the

description, or if it finds more than one object that

matches, QuickTest may use the............mechanism to

identify the object.



A) Ordinal Identifier

B) Index Identifier

C) Smart Identification

D) Assistive Identification



5) You can configure the ........, ............ and

............

properties that QuickTest uses to record descriptions of

the objects in your application



A) mandatory, assistive, and ordinal identifier

B) mandatory, required, and ordinal identifier

C) smart, assistive, and ordinal identifier

D) Index, assistive, and ordinal identifier



6) The .......... property set for each test object is

created and maintained by QuickTest.

A) Run-Time Object

B) Test Object

C) Smart Identification Object

D) Assistive Object



7)You can access and perform ......... methods using

the Object property.

A) Run-Time Object

B) Test Object

C) Smart Identification Object

D) Assistive Object



8) You can view or modify the test object property

values that are stored with your test in the .........



A) Information Pane

B) Data Table

C) Information Pane & Data Table Both

D) Object Properties & Object Repository dialog box.



9) You can retrieve or modify property values of the

test object during the run session by adding

..........statements in the Keyword View or Expert View.



A) GetROProperty & SetROProperty

B) GetTOProperty & SetTOProperty

C) GetTOProperty & SetROProperty

D) GetROProperty & SetTOProperty



10) If the available test object methods or properties

for an object do not provide the functionality you need,

you can access ..............of any run-time object

using the Object property.



A) The internal methods and properties

B) The mandatory methods and properties

C) The selective methods and properties

D) The assistive methods and properties



Answers

1) B, 2) A, 3) C, 4) C, 5) A, 6) B, 7) A, 8) D,

9) B, 10) A


QTP Certification Test Series 6

1) Using the Object Spy, you can view

A) the run-time or test object properties and methods of

any object in an open application.

B) the run-time or test object properties of any object

in an open application.

C) the test object properties and methods of any object

in an open application.

D) the run-time object properties and methods of any

object in an open application.



2) There are .........object type filters in Object spy

dialog box.

A) Two

B)Three

C) Four

D) Five



3) In the Object Spy window, in the Properties Tab

A) Copying of Properties and its values is possible with

CTRL+C

B) Copying of Properties and its values is possible by

right clicking on it and choosing copy.

C) Copying of Properties and its values is possible with

both A) and B) methods

D) Copying of Properties and its values is possible is

not possible



4) In the Object Spy window, in the methods Tab

A) Copying of Methods is possible with CTRL+C

B) Copying of Methods is possible by right clicking on

it and choosing copy.

C) Copying of Methods is possible with both A) and B)

methods

D) Copying of Methods is possible is not possible



5) Object Spy dialog box



A) Can be resized

B) Cannot be resized

6) .............. are the highest level of the test

hierarchy in the

Keyword view.



A) Tests

B) Steps

C) Call to Actions

D) Actions

7) You can copy and paste or drag and drop actions to

move them to a different location within a test

A) True

B) False

8) You can print the contents of the Keyword View to

your Windows default printer (and even preview the

contents prior to printing).

A) True

B) False

9) In the Keyword View, you can also view properties

for items such as checkpoints.

A) True

B) False

10) In the step Browser > Page > Edit > Set "Sachin",

identify container object(s)

A) Browser

B) Edit

C) Page

D) Both Browser & Page

Answers

1) A, 2) A, 3) A, 4) A, 5) A, 6) D, 7) A, 8) A,

9) A, 10) D


QTP Certification Test Series 7

1) You can use the Keyword View to add a step


..........in your test.

A) at the end

B) below the currently selected step

C) at the beginning

D) at anypoint

2) The Documentation cell is .............

A) Read-only

B) Write-only

C) Read and Write

D) Read, write & execute

3) An Item column can be any of the following:

A) A test object

B) A statement like Dim

C) A step generated by step generator

D) All of above

4) The Operation cell in the keyword view specifies the

operation to be performed on the item listed in the

........... column.

A) Operation

B) Documentation

C) Item

D) Value

5) Even if the Item column in the Keyword View is

displayed to the right of the Operation column, you must

still first select an item to view the list of available

operations in the Operation column.

A) True

B) False

6) The Value cell in the keyword view can

contain........ value

A) Constant

B) Parameter

C) Both A) & B)

D) None of these

7)The ............... enables you to encode your

passwords and place secure values into the Data Table.

A) Password Encoder

B) Password Decoder

C) Password Encode

D) Password Decode

8) You can also encrypt strings in Data Table cells

using the ......... option in the Data Table menu.

A) Decrypt

B) Encrypt

C) Encrypt Code

D) Decrypt Code

9) In addition to adding standard statement steps to

your test using the Keyword View, you can also insert



A) Checkpoint step

B) Output value step

C) Comment step

D) All of above

10) The correct syntax of the conditiona statement

starting with Do is.....

B) Do...Until

C) Do...Next`

D) Both A) and B)



Answers

1) D, 2) A, 3) D, 4) C, 5) A, 6) C, 7) A, 8) B,

9) D, 10) D

QTP Certification Test Series 8


71) QuickTest processes a comments when it runs a test.

A) True

B) False



72) Press ..... to add a new step below the currently

selected step.



A) F8

B) Shift + A

C) F0

D) Shift + A + Q

73) While working with the Keyword View, you can ......

steps to move them to a different location in a test or

in an action

A) Copy and Paste

B) Cut and Paste

C) Drag and drop

D) Both A) and C)

74) You can specify the order in which the columns are

displayed in the Keyword view.

A) True

B) False

75) You can view ....... while working with keyword

view.

A) object properties

B) action properties

C) action call properties

D) checkpoint properties

E) Output value properties

F) None of the above

G) All of above





76) You cannot manage some aspects of a local object

repository using the QuickTest Object Repository

automation object model..

A) True

B) False

77) For each action, you can use a combination of

objects from your local and shared object repositories.

A) True

B) False

78) QuickTest adds all new objects to the local object

repository even if one or more shared object

repositories are already associated with the action

assuming that an object with the same description does

not already exist in one of the associated shared object

repositories..

A) True

B) False

79) If a child object is added to a local object

repository, and its parents are in a shared object

repository, then you have to manually drag and drop its

parent objects from shared object repository to local

object repository.

A) True

B) False

80) The ....... is not accessible as a separate file

A) local object repository

B) shared object repository

C) Both

D) None

Answers

71) B, 72) A, 73) D, 74) A, 75) G, 76) B, 77) A, 78) A,

79) B, 80) A

QTP Certification Test Series 9

81) In the Object Repository window:.


A) Local objects are editable (black)

B) Shared objects are in read-only format (gray)

C) Local objects are in read-only format (gray)

D) Shared objects are editable (black)

82) Mark true statement(s):.

A) You can delete objects from a shared object repository using the Object Repository window.

B) You can delete objects from the local object repository using the Object Repository Manager

C) You can delete objects from the local object repository using the Object Repository window

D) You can delete objects from a shared object repository using the Object Repository Manager

83) You can modify an object stored in a shared object repository.

A) using the Object Repository Manager

B) using the Object Repository window

C) you can copy it to the local object repository and then modify its properties

D) you cannot modify properties of objects stored in Shared object repository

84) If an object is contained in both local and shared repositories then, during a run session.

A) QuickTest will use the object in the local object

repository

B) QuickTest will use the object in the Shared object

repository

C) There will be a conflict

D) QuickTest will use Descriptive Programming

85) When you copy an object to the local object


repository

A) its parent objects are also copied to the local

object repository

B) its parent objects are not copied to the local object

repository

C) You have to manually copy its parent objects are also

copied to the local object repository

D) You have to manually drag and drop its parent objects

86) For tests, you can also view test object properties


and property values for objects in the Active Screen,


regardless of whether the objects are


stored in the object repository.

A) True

B) False

87) Object Properties window differs for objects stored


in Shared and Local object repository.

A) True

B) False

88) You can rename objects in the shared object


repository using the Object Repository Manager

A) True

B) False, you cannot rename objects in shared object

repository

89) When you modify the name of an object in the local


object repository, the name is automatically updated in


....... for all occurrences of the object..

A) in the Keyword View

B) in the Expert View

C) Both Keyword and Expert View

D) Changing name of an object doest not effect keyword

or expert view

90) When you modify the name of an object in a shared


repository, the name is automatically updated in all


tests 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



Answers



81) A,B, 82) C,D, 83) A,C, 84) A, 85) A, 86) A, 87) A,

88) A, 89) C, 90) A



QTP Certification Test Series 10

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

QTP Certification Test Series 11

101) A test comprises calls to actions. When you create a new test, it contains a call to a ...... action.

A) One

B) Two

C) Three

D) Multiple

102) When you open a test, you can choose to view ......

A) the test flow (calls to actions)

B) you can view and edit the individual actions stored

with your test.

C) Both A & B

D) None

103) For every action called in your test, QuickTest creates a corresponding ........ in the Data Table so


that you can enter Data Table parameters that are specific to that action only.

A) action sheet

B) Excel sheet

C) Both A & B

D) None

104) When you create a test, it includes ..... action.

A) Single

B) unlimited

C) Three

D) Multiple

105) There are three kinds of actions:

A) non-reuse action, reuse action, external action

B) Call to internal action, Call to reusable action,

external action

C) non-reusable action, reusable action, external action

D) Call to non-reusable action, reusable action,

external action

106) By default, new actions are

A) Short

B) External

C) reusable

D) non-reusable

107) You can display or hide the Action toolbar in the

Keyword View by choosing ........

A) View > Toolbars > Action

B) View > Toolbars > Actions

C) View > Toolbar > Action

D) Views > Toolbars > Action

108) The ...... enables you to view either the entire test flow (the calls to the actions in the test) or you


can view the steps for a selected reusable or external action.

A) Action Flow

B) Action file

C) Action List

D) Action Repository

109) In the ......., the Action List is always visible

and the Expert View always displays the script for the

selected action.

A) Keyword View

B) Expert View

C) Action Flow

D) Action View

110) If the action is called more than once within the

test flow or if the action is called by a reusable

action, the Reusable action option is ......

A) read-only

B) write-only

C) both read and write

D) read-write-executable.

111) You cannot expand ...... actions from the test flow view.

A) reusable

B) non-reusable

C) both A & B

D) None

112) You can associate shared object repositories with


...... actions simultaneously, using the Associate


Repositories dialog box

A) seven

B) Two

C) Three

D) Multiple

113) 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

114) Sometimes you may want to call an action from

within an action. This is called .......

A) Reusability

B) Nesting

C) Sharing

D) None

115) 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

116) 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

117) 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

18) You can also press ...... to open the Rename Action

dialog box

A) Shift + F2

B) Shift + F3

C) Shift + F4

D) Shift + F5

119) 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

120) With QuickTest Professional 9.0, a maximum of

.......... Actions can be placed into a script

A) 110

B) 256

C) 120

D) 512

121) 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

101) a, 102) c, 103) a, 104) a, 105) c, 106) d, 107) a,

108) c, 109) b, 110) a, 111) a, 112) d, 113) c, 114) b,

115) b, 116) b, 117) b, 118) a, 119) d, 120) c, 121) a



QTP Certification Test Series 12

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

11) 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.

12) 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

13) 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

14) 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

15 ) 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

16) The Object Repository Manager enables you to open ...... shared object repositories and modify them as needed



A) multiple

B) three

C) two

D) Seven

17) ........ Method Loads the specified object repository.



A) Overload

B) Load

C) Both A & B

D) None

18) 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

19) 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

20) 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 changes even if you have not yet saved the object repository with your changes.



A) True

B) False



21) 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

22) ................ 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 Property



Answers



1) a, 2) b, 3) a, 4) a, 5) b, 6) b, 7) a, 8) c, 9) c, 10) a, 11) a, 12) b, 13) c, 14) a, 15) b, 16) a, 17) b , 18) a, 19) a, 20) a, 21) c, 22) c.

QTP Certification Test Series 13

1) If you do not want QuickTest to perform a step or checkpoint until an object in your application achieves a certain status, you should insert a .......... point to instruct QuickTest to pause the test until the object property achieves the value you specify




A) Synchronization

B) Check

C) Smart Identification

D) none of above

2) Where do we Specify the Maximum Time to Wait for a Web Page to Load



A) File->Settings, Web Tab.

B) Tools->Options, Web Tab.

C) Resources->Settings, Web Tab

D) None of above

3) You can insert ........ statements that instruct QuickTest to wait until an object exists



A) Exist

B) Wait

C) Both A & B

D) None

4) ...... Method Waits for the browser to complete the current navigation.



A) Exist

B) Wait

C) WaitProperty

D) Sync

5 ) Sub Sync_Example() Browser("Mercury Tours").Page("Mercury Tours").Sync

End Sub The above example uses the Sync method to wait for the Mercury Tours page to synchronize before performing the next operation.



A) True

B) False

6).....Property- The period of time QuickTest waits before checking the emulator status (in milliseconds).



A) SyncTime

B) Sync.Time

C) TimeSync

D) Time.Sync

7) ....... Property- Indicates whether QuickTest beeps after performing each Sync function during a run session.



A) BeepAfterSync

B) BeepOnSync

C) BeepSync

D) Beep.Sync

8) Unlike the Exist method, the ....... method enables you to synchronize the test run based on a specific object property.



A) WaitProperty

B) Wait

C) Sync

D) Exit

9) ...... Statement - Initiates a pause during a run session.



A) WaitProperty

B) Wait

C) Sync

D) Exit



10) ........... Property - The maximum time (in milliseconds) that QuickTest waits for a Web page to load before running a step.



A) BrowserTimeout

B) Browser_Navigation_Timeout

C) BrowserNavigationTimeout

D) Browser_Timeout

Answers



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



QTP Certification Test Series 14

1) The ........ checks a variety of objects such as buttons, radio buttons, combo boxes, lists, and so forth.




A) Image checkpoint

B) standard checkpoint

C) Bitmap checkpoint

D) Accessibility checkpoint



2) You create an image checkpoint by inserting a ........ on an image object.



A) Image checkpoint

B) standard checkpoint

C) Bitmap checkpoint

D) Accessibility checkpoint



3) ......... are also supported for some list view objects, such as WinListView and VbListView, as well as other list view objects in external add-in environments.



A) Table checkpoints

B) standard checkpoints

C) Accessibility checkpoints

D) XML checkpoints



4) .......identifies areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines.



A) Accessibility Checkpoint

B) standard checkpoints

C) Database checkpoints

D) Accessible Checkpoint



5) ........ Specifies the time interval (in seconds) during which QuickTest attempts to perform the checkpoint successfully.



A) Check timeout

B) Checkpoint interval timeout

C) Checkpoint timeout

D) Quicktest timeout



6) ........... Specifies when to perform the checkpoint in the test.



A) Insert statement.

B) Check statement.

C) timeout statement.

D) checkpoint statement.

7) You can view the results of the checkpoint in the........



A) Test Results window

B) Checkpoint window

C) Information Pane

D) Checklist window



8) By default, the bottom right part of the Test Results window displays information on the selected checkpoint only if it has the status Failed.



A) True

B) False

9) You can also use the ......... to check specific property values.



A) CheckProperty method

B) CheckItemProperty method

C) ItemProperty method

D) Property method



10) If you want to retrieve the return value of a checkpoint (a boolean value that indicates whether the checkpoint passed or failed), you must add ......... the checkpoint argument in the statement in the Expert View.



A) parentheses around

B) Properties with

C) Arguments with

D) Values alongwith



11) You can use a formula in a checkpoint to confirm that an object created on-the-fly (dynamically generated) or another variable object in your Web page or application contains the value it should for a given context.



A) True

B) False



12) You cannot modify the settings of existing checkpoints.



A) True

B) False

Answers:



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

QTP Certification Test Series 15

1) You can edit information in the Data Table by typing directly into the table cells.



A) True

B) False

2) Each row in the table represents the set of values that QuickTest submits for the ......... arguments during a single iteration of the test or action.



A) parameterized

B) Non-parameterized

C) distributed

D) None of above

3) For every action called in your test, QuickTest creates a corresponding ........ in the Data Table so that you can enter Data Table parameters that are specific to that action only.



A) action sheet

B) Excel sheet

C) Both A & B

D) None

4) When you create a test, it includes ..... action.



A) Single

B) unlimited

C) Three

D) Multiple

5) There are three kinds of actions:



A) non-reuse action, reuse action, external action

B) Call to internal action, Call to reusable action,

external action

C) non-reusable action, reusable action, external action

D) Call to non-reusable action, reusable action,

external action

6) By default, new actions are



A) Short

B) External

C) reusable

D) non-reusable

7) You can display or hide the Action toolbar in the Keyword View by choosing View > Toolbars > Action.



A) View > Toolbars > Action

B) View > Toolbars > Actions

C) View > Toolbar > Action

D) Views > Toolbars > Action

8) The ...... enables you to view either the entire test flow (the calls to the actions in the test) or you can view the steps for a selected reusable or external action.



A) Action Flow

B) Action file

C) Action List

D) Action Repository

9) In the ......., the Action List is always visible and the Expert View always displays the script for the selected action.



A) Keyword View

B) Expert View

C) Action Flow

D) Action View

10 ) ....... Method - Imports a sheet of a specified file to a specified sheet in the run-time Data Table.



A) SheetImport

B) ImportSheet

C) ImportDataTable

D) ImportTable

11) The column headings in the sheet you import must match the Data Table parameter names in the action for which the sheet is being imported. Otherwise, your test or component may fail.



A) True

B) False

12) The sheet you import automatically takes the name of the sheet it replaces.



A) True

B) False

13) The use of complex and/or nested formulas in the Data Table is supported.

A) True

B) False

14) The data your test uses is stored in the ....... Data Table, which is displayed in the Data Table pane at the bottom of the screen while you insert and edit steps.



A) design-time

B) Run-time

C) Current

D) None

15) During the run session, QuickTest creates a ....... Data Table—a live version of the Data Table associated with your test.



A) True

B) False

16) If it is important for you to save the resulting data from the run-time Data Table, you can insert a ..........statement to the end of your test to export the run-time Data Table to a file.



A) Export.Datatable

B) DataTable_Export

C) DataTable.Export

D) Both A & B

17) When you parameterize a step in a test using the Data Table, you must decide whether you want to make it a global Data Table parameter or an action Data Table parameter.



A) True

B) False

18) After running a parameterized test, you can view the actual values taken from the Data Table in the Test Results Run-Time Data Table.



A) True

B) False

19) ...... Property - Returns the design-time Data Table, which enables you to modify the data that is used for the Data Table parameters in your test or business component.



A) DataTable

B) DesignTable

C) Design_Table

D) None

20) The Data Table assists you in parameterizing your test.

A) True

B) False



Answers

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

15) a, 16) c, 17) a, 18) a, 19) a, 20) a


QTP Certification Test Series 16

1) Programmatic description can be very useful if you want to perform an operation on an object that is stored in the object repository.



A) True

B) False

2) There are two types of programmatic descriptions:



A) Static & Dynamic

B) Statement & Dynamic

C) Step & Dynamic

D) Standard & Dynamic

3) You can also use programmatic descriptions to perform the same operation on several objects with certain identical properties, or to perform an operation on an object whose properties match



a description that you determine dynamically during the run session.

A) True

B) False

4) QuickTest evaluates all property values in programmatic descriptions as regular expressions



A) True

B) False



5) From the below 4 statements which one is invalid:



A) Browser("title:=Mercury Tours").Page("title:=Mercury Tours").WebEdit("Name:=Author", "Index:=3").Set "G C Reddy"

B) Browser("Index").Page(Desc1).Link(docu3)

C) Browser("Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Name:=Author", "Index:=3").Set " G C Reddy"

D) Browser("Title:=Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Author").Set " G C Reddy "

6) When using programmatic descriptions from a specific point within a test object hierarchy, you must continue to use programmatic descriptions from that point onward within the same statement.



A) True

B) False

7) You can run any application from a specified location using a ..... statement.



A) Start.Application

B) System.UtilRun

C) SystemUtil.Run

D) SystemUtii.RUn



8) When creating a programmatic description for an ActiveX test object and the relevant run-time object is windowless (has no window handle associated with it), you must add the ........ property to the description and set its value to True.



A) Window Handle

B) WindowLess

C) Winless

D) None



9) You can compare the run-time value of a specified object property with the expected value of that property using either programmatic descriptions or user-defined functions.



A) True

B) False

10) When you specify an application to open using the Record and Run Settings dialog box, QuickTest adds a SystemUtil.Run statement to your test.



A) True

B) False





11) You can use the Expert View tab to view a text-based version of your test.



A) True

B) False



12) Expert View contains each step as a VBScript line. In object-based steps, the VBScript line defines the ........ hierarchy.



A) Action

B) Object

C) Test

D) Step



13) If you focus on a specific step in the Keyword View and switch to the Expert View, the cursor is located in that ..... line of the test.



A) Next

B) Previous

C) Last

D) Corresponding



14) For each object and method in an Expert View statement, a corresponding row exists in the Keyword View.



A) True

B) False

15) When you switch from the Expert View to the Keyword View, QuickTest automatically checks for syntax errors in your script, and shows them in the Information pane.



A) True

B) False

16) In the Expert View, the ....... is always visible and the Expert View always displays the script for the selected action.



A) Action List

B) Expert List

C) Check List

D) View List



17) You can insert a checkpoint or output value statement in the Expert View manually.



A) True

B) False

18) You can copy a Checkpoint or Output statement from the Expert View to another test.



A) True

B) False



19) You can also manually enter standard VBScript statements, as well as statements using QuickTest test objects and methods, in the Expert View.



A) True

B) False

20) You cannot print the test displayed in the Expert View or a function library.



A) True

B) False

21) When you type in the Expert View or a function library, .......... enables you to select the test object, method, property, or collection for your statement from a drop-down list and view the relevant syntax.



A) Object Property dialog box

B) Web edit Property dialog box

C) Intellisense

D) dropdown list



22) Using QuickTest, you can define and store your user-defined functions in a .....



A) function library

B) directly in an action within a test.

C) both A & B

D) None

23) Default file extention of function library is



A) .flf

B) .qtfl

C) .qfl

D) .tfl



24) When you store a function in a test action, it can be called from any other action or test.



A) True

B) False



25) You cannot define private functions and store them in a function library.



A) True

B) False



26) You can drag and drop a function (or part of it) from one document to another.



A) True

B) False



27) You can add steps to your function library manually or using the Step Generator.



A) Manually

B) using Step Generator

C) Both A & B

D) None



28) In function libraries, IntelliSense does not enable you to view test object names or collections because function libraries are not connected to object repositories.



A) True

B) False



29) Function Libraries can be edited during the debug session.



A) True

B) False



30) To close all open function libraries:



A) Choose File > Close All Function Libraries,

B) Window > Close All Function Libraries.

C) Widow > Close All

D) Both A & B



31) Any text file written in standard VBScript syntax can be used as a function library.



A) True

B) False



32) If you create a user-defined function manually and do not define the scope as Public or Private, it will be treated as a ..... function, by default.



A) Private

B) Public

C) Both A & B

D) None



33) If you choose not to register your function at this time, you can manually register it later by adding a RegisterUserFunc statement after your function



A) RegisterUserFunction

B) RegisterUserFunc

C) RegUserFunc

D) Both A & B


QTP Certification Test Series 17

1) Regular expressions enable QuickTest to identify objects and text strings with undependable values.




A) True

B) False



2) You can use regular expressions only for values of type string and number.



A) True

B) False



3) If you expect the value of a property to change in an unpredictable way during each run session, you can use regular expressions



A) True

B) False



4) All ........ are automatically treated as regular expressions.



A) programmatic description

B) Window

C) WinObject

D) Collection



5) If a backslash character is used before a character that has no special meaning, the backslash is ignored.



A) True

B) False



6) You can use regular expressions in the Find what and Replace with strings to enhance your search.



A) True

B) False



7) Regular Expressions can also be used with XML checkpoints.



A) True

B) False



8) What is the Regular Expression Matching Zero or More Specific Characters



A) x

B) #

C) *

D) &

Answers



1) A, 2) B, 3) B, 4) A, 5) A, 6) A, 7) A, 8) c

QTP Certification Test Series 18

1) Virtual objects enable you to record and run tests on objects that are normally recognized by QuickTest.




A) True

B) False



2) In the test results, the virtual object is displayed as though it is a standard class object.



A) True

B) False



3) QuickTest does not support virtual objects for .......recording.



A) analog

B) low-level

C) normal

D) both A & B

E) both A & C



4) You can use the Object Spy to view virtual object properties.



A) True

B) False



5) You cannot insert any type of checkpoint on a virtual object



A) True

B) False



6) The ............ contains all the virtual object collections defined on your computer.



A) Virtual Objects Manager

B) Virtual Manager

C) Virtual Object Manager

D) Virtual Object Wizard



7) Extension of virtual object collection files



A) .vcf

B) .vot

C) .vct

D) .vcd



8) You can remove virtual objects from your test by .......these objects.



A) disabling recognition of

B) deleting

C) deleting virtual object collection files of

D) All of Above

E) both A & B



9) When you want QuickTest to recognize virtual objects during recording, ensure that the ....... check box in the General tab of the Options dialog box is cleared.



A) Disable recognition of virtual object Files while recording

B) Disable recognition of virtual object Collection while recording

C) Disable recognition of virtual objects while recording

D) Enable recognition of virtual objects while recording



10) QuickTest identifies a virtual object according to its ......



A) Properties

B) Boundaries

C) Object Spy

D) Edges





Answers



1) B, 2) A, 3) D, 4) B, 5) A, 6) C, 7) b, 8) E, 9) C, 10) B





QTP Certification Test Series 19

1) Recovery scenarios activate specific recovery operations when ......... occur.




A) Specific Errors

B) Test Errors

C) Trigger Events

D) QTP Errors



2) You can also control and activate your recovery scenarios during the run session by inserting.............. into your test.



A) Trigger Events

B) Recovery Events

C) Recovery Statements

D) Catch Statements



3) If you choose On error in the Activate recovery scenarios box in the Recovery tab of the Test Settings dialog box, the recovery mechanism does not handle triggers that occur in the last step of a test.



A) True

B) False



4) By default, recovery scenario operations are activated only after a step returns an error.



A) True

B) False



5) A ....... is a convenient way to organize and store multiple recovery scenarios together.



A) recovery file

B) recovery folder

C) Recovery Log

D) Log File



6) The Recovery Scenario Manager dialog box enables you to create and edit recovery files, and does not let you create and manage the recovery scenarios stored in those files.



A) True

B) False





7) Each recovery scenario is represented by an icon that indicates its type.



A) True

B) False



8) The Recovery Operations screen in Recovery Scenario Wizard enables you to manage the collection of ........in the recovery scenario.



A) recovery operations

B) recovery Files

C) Trigger events

D) All of Above



9) If you define a Restart Microsoft Windows recovery operation, it is always inserted as the last recovery operation, and you can change its position in the list.



A) True

B) False



10) If more than one scenario uses a function with the same name from different function libraries, the recovery process may fail.



A) True

B) False



Answers



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

QTP Certification Test series 20

1) To debug a function library, you must first associate it with a test and then debug it from that test.




A) True

B) False



2) To detect and isolate defects in a test or function library, you can control the run session using the ....command



A) Pause

B) Run

C) F14

D) Session



3) When the test or function library run stops at a breakpoint, you can use the ...... to check and modify the values of VBScript objects and variables.



A) Debug Window

B) Debug Dialog

C) Debug Viewer

D) Debug page



4) While the test and function libraries are running in debug mode, they are read-only



A) True

B) False



5) You cannot debug a file that is called using an ......statement, or any of the functions contained in the file.



A) ExecuteFiles

B) Execute_File

C) Execute-File

D) ExecuteFile



6) The debug session can continue at the backend while you can perform file operations like opening a new test etc.



A) True

B) False



7) Any changes you apply to external resources saved in the file system, such as function libraries, are implemented only when the test is closed and reopened but any changes you apply to any external resource that is saved in your Quality Center project, such as a function library, will be implemented immediately.



A) True

B) False



8) You can use the .......... command to begin your debug session at a specific point in your test.



A) Start from Step

B) Run to Step

C) Run from Step

D) Start to Step



9) You can specify the time (in milliseconds) QuickTest pauses between each step by modifying the ..... option in the Run tab of the Options dialog box (Tools > Options).



A) Delay step execution by

B) Delay every step execution by

C) Delay all steps execution by

D) Delay each step execution by



10) To display the Debug toolbar, choose ............



A) View > Toolbar > Debug

B) View > Toolbars > Debugs

C) Views > Toolbar > Debug

D) View > Toolbars > Debug



Answers

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



QTP Certification Test series 21

1) You can install the QuickTest...... add-ins (Web, ActiveX, Visual Basic) when you install QuickTest Professional, or you can install the QuickTest built-in add-ins at a later time by running the installation again.




A) internal

B) external

C) built-in

D) All of above

2) Add-ins that are installed separately from the QuickTest Professional installation are referred to as .......add-ins.



A) internal

B) external

C) built-in

D) built-out

3) When QuickTest opens, you can choose which of the installed add-ins you want to load using the QuickTest Professional - ...... dialog box.



A) Add-In Window

B) Add-In

C) Add-In Manager

D) Add-In Management



4) Installing and Loading an Add-in is one and the same thing.



A) True

B) False



5) You can install Add-in Upgrade patches by running the relevant patch executable from the \...... folder.



A) AddinsUpdate

B) AddinsUpgrade

C) Addins_upgrade

D) Both A & B



6) In Add-in Manager dialog box, Time-Limited column displays values only when using a QuickTest seat license — not a concurrent license.



A) True

B) False

7) You can view the list of add-ins that are currently installed or loaded by choosing ...................



A) File > Settings

B) Tools > Options and click the General tab.

C) Help > About QuickTest Professional.

D) both A & B



8) To maximize performance and object identification reliability, load all the add-ins.



A) True

B) False

9) The add-in is displayed as Not Licensed in the License column of the Add-in Manager dialog box:



A) If an add-in license has not yet been installed for a

specific external add-in.

B) if no concurrent license server within your subnet

has a registered license for the specific add-in

C) if all concurrent licenses are in use

D) All of Above



10) You can use only one license type per session for QuickTest Professional and all loaded add-ins-either seat or concurrent.



A) True

B) False

Answers:

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



QTP Certification Test Series 22

1) Before you record or run a test on a Web or Windows application, you can use the .... dialog box to instruct QuickTest which applications to open when you begin to record or run your test.




A) Record and Run

B) Record and Run Settings

C) Run and Record

D) Run and Record Settings



2) If you define environment variables to specify the record and run details, those values override the values in the Record and Run dialog box.



A) True

B) False



3) You can record tests only on ............



A) Microsoft Internet Explorer

B) Netscape Browser

C) Mozilla Firefox

D) Opera

4) Record and Run Settings window contains two tabs



A) Web & Window

B) Web & Windows Applications

C) Web & Window Applications

D) Web & Windows Application



5) You can add up to ... applications to the application list displayed in the Windows Applications tab



A) 10

B) 12

C) 24

D) 64



6) You can use special, predefined environment variables to specify the applications or browsers you want to use for your test while specifying the Record and Run Details



A) True

B) False



7) If you select the option to Record and Run on any application or browser (the upper radio button in each tab of the Record and Run Settings dialog box), QuickTest ..... any defined record and run environment variables.



A) does not

B) ignores

C) may or may not ignore

D) None of above



8) To use environment variables to specify the applications or browsers you want to use for your test run, you must use the appropriate variable names E.g. the variable name for the Web address to display in the browser is



A) URL_VAR

B) URL_EN

C) URL_ENV

D) URL_VA



9) The setting of the Active Screen capture level (Tools > Options > Active Screen tab) can significantly affect the ..... for your test and the functionality of the Active Screen while editing your test.



A) repeating time

B) waiting time

C) average time

D) recording time

10) The Web tab (Record and Run Settings dialog box) is available only when Web support is installed and loaded.



A) True

B) False



Answers:

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



QTP Certification Test Series 23


1) The ...... enables you to view either the entire test flow (the calls to the actions in the test) or you can view the steps for a selected reusable or external action.



A) Action Menu

B) Action List

C) Action Toolbar

D) Action View



2) You can view the ....... of the original action in the General tab of the Action Properties dialog box.



A) Parameters

B) Location

C) Associated Repositories

D) Type



3) You can create an additional call to any reusable or external action in your test by pressing ...... while you drag and drop the action to another location at a parallel (sibling) level within your test.



A) F3

B) alt

C) shift

D) ctrl



4) You can use action parameters in any step in your action (including function calls).



A) True

B) False



5) Input values for an action parameter can be retrieved



A) from the test (for a top-level action)

B) from the parameters of the parent action that calls

it (for a nested action)

C) from the output of a previous action call (for a

sibling action)

D) All of above



6) The Action Call Properties dialog box enables you to set options that apply only to a ...... action call.



A) following

B) preceeding

C) specific

D) internal



7) Specifying input and output parameter values in action calls is .......



A) required

B) optional

C) required only for internal action

D) both A & B



8) You can share a value that is generated in one action with other actions in your test by storing the value in the ..... Data Table.



A) Internal

B) External

C) Local

D) Global



9) ExitAction:



A) Exits the current action, regardless of its iteration attributes.

B) Exits the current iteration of the action.

C) Exits the test, regardless of its iteration attributes.

D) Exits the current global iteration.

10) If the action called by the RunAction statement includes an ExitAction statement, the RunAction statement can return the value of the ExitAction's RetVal argument.



A) True

B) False

Answers:

1) B, 2) B, 3) D, 4) A, 5) D, 6) C, 7) b, 8) d, 9) A, 10) A






QTP Certification Test Series 24

1) If an object with the same name and description is located in both the local object repository and in a shared object repository that is associated with the same action, the action uses the ...... object definition.




A) shared

B) local

C) Can use any

D) None of above.

2) You cannot use the same shared object repository with multiple actions.



A) True

B) False

3) If one or more of the property values of an object in your application differ from the property values QuickTest uses to identify the object, your test ..... fail.



A) may

B) must

C) should

D) will certainly

4) You can open as many shared object repositories as you want.



A) True

B) False

5) You can also open an object repository from the.......... in the File menu.



A) Recent Folders list

B) Current Files list

C) Recent Files list

D) Both A & c

6)QuickTest saves the object repository with a .....extension in the specified location



A) .vsr

B) .tsr

C) .lsr

D) .qsr

7) If you opened the object repository in ...... mode, you must enable editing for the object repository before you can modify it.



A) read-write mode

B) read-execute mode

C) read-write-execute mode

D) read-only mode

8) You can also modify a shared object repository bymerging it with another shared object repository.



A) True

B) False

9) You can also add objects to a shared object repository using the ....... option.



A) Navigate and Learn

B) Navigate and earn

C) Navigate

D) Navigate and Click

10) While Finding Objects in an Object Repository, You can use the Find and Replace dialog box to replace property or object names.



A) True

B) False

Answers

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



QTP Certification Test Series 25


1) In the Expert View, you can use the Object property to activate the method for a Web object.



A) True

B) False

2) The test object property set for each test object is created and maintained by....... The run-time object property set for each run-time object is created and maintained by the object creator



A) Microsoft

B) Adobe

C) HP

D) QuickTest



3) You can view or modify the test object property values that are stored with your component in the Object Properties or Object Repository dialog box.



A) True

B) False



4) It is possible that you can use the Object property to access the native properties of any run-time object.



A) True

B) False



5) You cannot retrieve the values of test object properties from a run-time object.



A) True

B) False

6) You can use the GetTOProperty, GetTOProperties, and SetTOProperty methods in your ........ to set and retrieve the test object property values of the test object.



A) Test

B) Function Library

C) Applciation area

D) Both A & B



7) Because QuickTest refers to the temporary version of the test object during the run session, any changes you make using the SetTOProperty method apply only during the course of the run session, and do not affect the values stored in the test object repository.



A) True

B) False

8) You can use the Object Spy at any time to view .....properties and values of the objects in the application you are testing.



A) run-time

B) test object

C) Both A & B

D) None

9) You cannot add to the list of properties that QuickTest uses to identify an object.

A) True

B) False

10) The default properties for a Link object (hypertext link) are...



A) Name

B) text

C) HTML tag

D) Tag



Answers:

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


QTP Certification Questions Series 26


1) Text (or text area) checkpoints may behave differently in different run sessions depending on the APIs used in your application



A) True

B) False



2) Using the Windows API, you can extend testing abilities and add usability and flexibility to your...... .



A) tests

B) function libraries

C) applications

D) Both A & B



3) API functions are located inside Windows DLLs



A) True

B) False



4) Integrating QuickTest with Quality Center enables you to store and access files in a Quality Center project, as well as use the....... object to access the wide range of functionality provided in the Quality Center Open Test Architecture API.



A) QCUtil

B) QCUtility

C) QCUtill

D) QCUntil



5) QuickTest works directly with the SAP Gui Scripting API to record your operations. Therefore, QuickTest adds steps to your test or component only when ........ are sent to the server.



A) API catches

B) API events

C) API starts

D) API stops



6) QuickTest communicates directly with the SAP Gui Scripting API to record and run your operations on SAP Windows objects.



A) True

B) False



7)........... declares references to external procedures in a dynamic-link library



A) Declare

B) Extern

C) Intern

D) None



8) The QuickTest automation object model supplies a type library file named ........... This file is stored in \bin.



A) QTObjectModel.dll

B) QTObjectModell.dll

C) QTObjecModel.dll

D) Both A & B



9) If you want to call a QuickTest test containing Stingray objects from WinRunner or vice versa, you must first ensure that WinRunner and QuickTest are both using the latest version of the Stingray agent. To do this, search for the .......... file in \bin and in \arch. Then replace the earlier file with the later one.



A) Stagent.dll

B) Stagerent.dll

C) Staent.dll

D) Stagents.dll





10) In the General tab of Options dialog box, Use text recognition mechanisms in this order: (Please select valid options from below)



A) First Windows API then OCR

B) First Windows API then LCR

C) First Windows API then MCR

D) First Windows API then NCR



Answers:

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

Tuesday, February 21, 2012

Learn VB Script

VB Script Examples
‘**************************************************************************
'1 Print Hello World
‘**************************************************************************

Print "Hello World"

‘**************************************************************************
'2 Find whether given number is a odd number
‘**************************************************************************
Dim oNumber
oNumber=4
If oNumber mod 2 <>0 Then
Print "The Number "& oNumber &" is an Odd Number"
else
Print "The Number "& oNumber &" is not an Odd Number"
End If

‘**************************************************************************
'3 Print odd numbers between given range of numbers
‘**************************************************************************

Dim RangeStart
Dim RangeEnd
Dim iCounter
RangeStart=10
RangeEnd=20

For iCounter=RangeStart to RangeEnd

If iCounter mod 2 <>0 Then
Print oNumber
End If

Next

‘**************************************************************************
'4 Find the factorial of a given number
‘**************************************************************************

Dim oNumber
Dim iCounter
Dim fValue

oNumber=6
fValue=1

For iCounter=oNumber to 1 step-1
fValue=fValue*iCounter
Next
print fValue

‘**************************************************************************
'5 Find the factors of a given number
‘**************************************************************************
Dim oNumber
Dim iCounter

oNumber=10

For iCounter=1 to oNumber/2
If oNumber mod iCounter=0 Then
print iCounter
End If
Next
print oNumber

‘**************************************************************************
'6 Print prime numbers between given range of numbers
‘**************************************************************************

Dim RangeStart
Dim RangeEnd
Dim iCounter
RangeStart=1
RangeEnd=30

For iCounter=RangeStart to RangeEnd

For iCount=2 to round(iCounter/2)
If iCounter mod iCount=0 Then
Exit for
End If
Next

If iCount=round(iCounter/2)+1 or iCounter=1 Then
print iCounter
End If
Next


‘**************************************************************************
'7 Swap 2 numbers with out a temporary variable
‘**************************************************************************

Dim oNum1
Dim oNum2

oNum1=1055
oNum2=155

oNum1=oNum1-oNum2
oNum2=oNum1+oNum2
oNum1=oNum2-oNum1
print oNum1
print oNum2

‘**************************************************************************
'8 Write a program to Perform specified Arithmetic Operation on two given numbers
‘**************************************************************************
Dim oNum1
Dim oNum2
Dim oValue

oNum1=10
oNum2=20

OperationtoPerform="div"

Select Case lcase(OperationtoPerform)

Case "add"
oValue=oNum1+oNum2
Case "sub"
oValue=oNum1-oNum2
Case "mul"
oValue=oNum1*oNum2
Case "div"
oValue=oNum1/ oNum2
End Select
print oValue

‘**************************************************************************
'9 Find the length of a given string
‘**************************************************************************
Dim oStr
Dim oLength
oStr="Sudhindra"
oLength=len(oStr)
print oLength

‘**************************************************************************
10 Reverse given string
‘**************************************************************************
Dim oStr
Dim oLength
Dim oChar
Dim iCounter

oStr="Sudhindra"
oLength=len(oStr)

For iCounter=oLength to 1 step-1
oChar=oChar&mid(oStr,iCounter,1)
Next
print oChar

‘**************************************************************************
11 Find how many alpha characters present in a string.
‘**************************************************************************
Dim oStr
Dim oLength
Dim oChar
Dim iCounter

oStr="su1h2kar"
oLength=len(oStr)

oAlphacounter=0

For iCounter=1 to oLength

If not isnumeric (mid(oStr,iCounter,1)) then
oAlphacounter=oAlphacounter+1
End if

Next
print oAlphacounter

‘**************************************************************************
12 Find occurrences of a specific character in a string
‘**************************************************************************
Dim oStr
Dim oArray
Dim ochr
oStr="Sudhindra"
ochr="a"

oArray=split(oStr,ochr)
print ubound(oArray)
‘**************************************************************************
13 Replace space with tab in between the words of a string.
‘**************************************************************************
Dim oStr
Dim fStr

oStr="Quick Test Professional"

fStr=replace(oStr," ",vbtab)
print fStr

‘**************************************************************************
'14 Write a program to return ASCII value of a given character
‘**************************************************************************
Dim ochr
Dim aVal

ochr="A"

aVal=asc(ochr)
print aVal

‘**************************************************************************
'15 Write a program to return character corresponding to the given ASCII value
‘**************************************************************************
Dim ochr
Dim aVal

aVal=65

oChr=chr(aVal)
print oChr

‘**************************************************************************
'16 Convert string to Upper Case
‘**************************************************************************
Dim oStr
Dim uStr

oStr="QuickTest Professional"

uStr=ucase(oStr)
print uStr

‘**************************************************************************
'17 Convert string to lower case
‘**************************************************************************
Dim oStr
Dim lStr

oStr="QuickTest Professional"
lStr=lcase(oStr)
print lStr


‘**************************************************************************
'18 Write a program to Replace a word in a string with another word
‘**************************************************************************

Dim oStr
Dim oWord1
Dim oWord2
Dim fStr

oStr="Mercury Quick Test Professional"
oWord1="Mercury"
oWord2="HP"

fStr=replace(oStr,oWord1,oWord2)
print fStr
‘**************************************************************************
'19 Check whether the string is a POLYNDROM
‘**************************************************************************

Dim oStr

oStr="bob"
fStr=StrReverse(oStr)
If oStr=fStr Then
Print "The Given String "&oStr&" is a Palindrome"
else
Print "The Given String "&oStr&" is not a Palindrome"
End If

‘**************************************************************************
'20 Verify whether given two strings are equal
‘**************************************************************************
Dim oStr1
Dim ostr2

oStr1="qtp"
oStr2="qtp"
If oStr1=oStr2 Then
Print "The Given Strings are Equal"
else
Print "The Given Strings are not Equal"
End If

‘**************************************************************************
'21 Print all values from an Array
‘**************************************************************************
Dim oArray
Dim oCounter
oArray=array(1,2,3,4,"qtp","Testing")

For oCounter=lbound(oArray) to ubound(oArray)
print oArray(oCounter)
Next


‘**************************************************************************
'22 Sort Array elements
‘**************************************************************************
Dim oArray
Dim oCounter1
Dim oCounter2
Dim tmp

oArray=array(8,3,4,2,7,1,6,9,5,0)

For oCounter1=lbound(oArray) to ubound(oArray)

For oCounter2=lbound(oArray) to ubound(oArray)-1

If oArray(oCounter2)>oArray(oCounter2+1) Then
tmp=oArray(oCounter2)
oArray(oCounter2)=oArray(oCounter2+1)
oArray(oCounter2+1)=tmp
End If

Next

Next

For oCounter1=lbound(oArray) to ubound(oArray)
print oArray(oCounter1)
Next


‘**************************************************************************
'23 Add two 2X2 matrices
‘**************************************************************************
Dim oArray1(1,1)
Dim oArray2(1,1)
Dim tArray(1,1)

oArray1(0,0)=8
oArray1(0,1)=9
oArray1(1,0)=5
oArray1(1,1)=-1

oArray2(0,0)=-2
oArray2(0,1)=3
oArray2(1,0)=4
oArray2(1,1)=0

tArray(0,0)=oArray1(0,0)+ oArray2(0,0)
tArray(0,1)=oArray1(0,1)+oArray2(0,1)
tArray(1,0)=oArray1(1,0)+oArray2(1,0)
tArray(1,1)=oArray1(1,1)+oArray2(1,1)

‘**************************************************************************
'24 Multiply Two Matrices of size 2X2
‘**************************************************************************

Dim oArray1(1,1)
Dim oArray2(1,1)
Dim tArray(1,1)

oArray1(0,0)=8
oArray1(0,1)=9
oArray1(1,0)=5
oArray1(1,1)=-1

oArray2(0,0)=-2
oArray2(0,1)=3
oArray2(1,0)=4
oArray2(1,1)=0

tArray(0,0)=oArray1(0,0)* oArray2(0,0)+ oArray1(0,1)* oArray2(1,0)
tArray(0,1)=oArray1(0,0)* oArray2(0,1)+ oArray1(0,1)* oArray2(1,1)
tArray(1,0)=oArray1(1,0)* oArray2(0,0)+ oArray1(1,1)* oArray2(1,0)
tArray(1,1)=oArray1(1,0)* oArray2(0,1)+ oArray1(1,1)* oArray2(1,1)

‘**************************************************************************
'25 Convert a String in to an array
‘**************************************************************************

Dim oStr
Dim iCounter
oStr="Quick Test Professional"
StrArray=split(oStr)

For iCounter=0 to ubound(StrArray)
print StrArray(iCounter)
Next


‘**************************************************************************
'26 Convert a String in to an array using ‘i‘ as delimiter
‘**************************************************************************

Dim oStr
Dim iCounter
oStr="Quick Test Professional"
StrArray=split(oStr,"i")

For iCounter=0 to ubound(StrArray)
print StrArray(iCounter)
Next

‘**************************************************************************
'27 Find number of words in string
‘**************************************************************************

Dim oStr
Dim iCounter
oStr="Quick Test Professional"
StrArray=split(oStr," ")
print "Theere are "&ubound(StrArray)+1&" words in the string"

‘**************************************************************************
'28 Write a program to reverse the words of a given string.
‘**************************************************************************

Dim oStr
Dim iCounter
oStr="Quick Test Professional"
StrArray=split(oStr," ")

For iCounter=0 to ubound(StrArray)
print strreverse(StrArray(iCounter))
Next


‘**************************************************************************
'29 Print the data as a Pascal triangle
‘**************************************************************************
'The formulae for pascal triangle is nCr=n!/(n-r)!*r!

Dim PascalTriangleRows
Dim nCr
Dim NumCount
Dim RowCount

PascalTriangleRows = 10
For NumCount = 0 To PascalTriangleRows
toPrint= Space(PascalTriangleRows - NumCount)
For RowCount = 0 To NumCount
If (NumCount = RowCount) Then
nCr = 1
Else
nCr = Factorial(NumCount) / (Factorial(NumCount - RowCount) * Factorial(RowCount))
End If
toPrint=toPrint&nCr&" "
Next
print toPrint
Next


Function Factorial(num)
Dim iCounter
Factorial = 1
If num <> 0 Then
For iCounter = 2 To num
Factorial = Factorial * iCounter
Next
End If
End Function

‘**************************************************************************
'30 Join elements of an array as a string
‘**************************************************************************

Dim oStr
Dim iCounter
oStr="Quick Test Professional"
StrArray=split(oStr," ")

print join(StrArray," ")


‘**************************************************************************
'31 Trim a given string from both sides
‘**************************************************************************

Dim oStr

oStr=" QTP "
print trim(oStr)


‘**************************************************************************
'32 Write a program to insert 100 values and to delete 50 values from an array
‘**************************************************************************

Dim oArray()
Dim iCounter

ReDim oArray(100)

For iCounter=0 to ubound(oArray)
oArray(iCounter)=iCounter
'Print total 100 Values
print(oArray(iCounter))
Next
print "******************************"
print "******************************"
ReDim preserve oArray(50)

For iCounter=0 to ubound(oArray)
'Print Values after deleting 50 values
print(oArray(iCounter))
Next

‘**************************************************************************
'33 Write a program to force the declaration of variables
‘**************************************************************************

Option explicit ' this keyword will enforce us to declare variables

Dim x
x=10
'Here we get an error because i have not declared y,z
y=20
z=x+y
print z

‘**************************************************************************
'34 Write a program to raise an error and print the error number.
‘**************************************************************************

On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
print ("Error # " & CStr(Err.Number) & " " & Err.Description)


‘**************************************************************************
'35 Finding whether a variable is an Array
‘**************************************************************************

Dim oArray()

if isarray(oArray) then
print "the given variable is an array"
else
print "the given variable is not an array"
End if

‘**************************************************************************
'36 Write a program to list the Time zone offset from GMT
‘**************************************************************************
Dim objWMIService
Dim colTimeZone
Dim objTimeZone

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colTimeZone = objWMIService.ExecQuery("Select * from Win32_TimeZone")

For Each objTimeZone in colTimeZone
print "Offset: "& objTimeZone.Bias
Next

‘**************************************************************************
'37 Retrieving Time Zone Information for a Computer
‘**************************************************************************
Dim objWMIService
Dim colTimeZone
Dim objTimeZone

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colTimeZone = objWMIService.ExecQuery("Select * from Win32_TimeZone")

For Each objItem in colTimeZone

print "Bias: " & objItem.Bias
print "Caption: " & objItem.Caption
print "Daylight Bias: " & objItem.DaylightBias
print "Daylight Day: " & objItem.DaylightDay
print "Daylight Day Of Week: " & objItem.DaylightDayOfWeek
print "Daylight Hour: " & objItem.DaylightHour
print "Daylight Millisecond: " & objItem.DaylightMillisecond
print "Daylight Minute: " & objItem.DaylightMinute
print "Daylight Month: " & objItem.DaylightMonth
print "Daylight Name: " & objItem.DaylightName
print "Daylight Second: " & objItem.DaylightSecond
print "Daylight Year: " & objItem.DaylightYear
print "Description: " & objItem.Description
print "Setting ID: " & objItem.SettingID
print "Standard Bias: " & objItem.StandardBias
print "Standard Day: " & objItem.StandardDay
print "Standard Day Of Week: " & objItem.StandardDayOfWeek
print "Standard Hour: " & objItem.StandardHour
print "Standard Millisecond: " & objItem.StandardMillisecond
print "Standard Minute: " & objItem.StandardMinute
print "Standard Month: " & objItem.StandardMonth
print "Standard Name: " & objItem.StandardName
print "Standard Second: " & objItem.StandardSecond
print "Standard Year: " & objItem.StandardYear

Next


‘**************************************************************************
'38 Write a program to Convert an expression to a date
‘**************************************************************************
Dim StrDate
Dim actualDate
Dim StrTime
Dim actualTime

StrDate = "October 19, 1962" ' Define date.
actualDate = CDate(StrDate) ' Convert to Date data type.
print actualDate
StrTime = "4:35:47 PM" ' Define time.
actualTime = CDate(StrTime) ' Convert to Date data type.
print actualTime


‘**************************************************************************
'39 Display current date and Time
‘**************************************************************************

print now

‘**************************************************************************
'40 Find difference between two dates.
‘**************************************************************************

'Date difference in Years
print DateDiff("yyyy","12/31/2002",Date)

'Date difference in Months
print DateDiff("m","12/31/2002",Date)

'Date difference in Days
print DateDiff("d","12/31/2002",Date)


‘**************************************************************************
'41 Add time interval to a date
‘**************************************************************************

print DateAdd("m", 1, "31-Jan-95")


‘**************************************************************************
'42 Print current day of the week
‘*************************************************************************
Print day(date)
‘**************************************************************************
'43 Find whether current month is a long month
‘**************************************************************************
Dim oCurrentMonth
Dim ocurrentYear
Dim oDaysinMonths

oCurrentMonth = Month(date)
ocurrentYear = Year(date)
oDaysinMonths=Day(DateSerial(ocurrentYear, oCurrentMonth + 1, 0))
print oDaysinMonths&" Days in Current Month"
If oDaysinMonths=31 Then
print "Current Month is a long month"
else
print "Current Month is not a long month"
End If

‘**************************************************************************
'44 Find whether given year is a leap year
‘**************************************************************************

'1st Method

'The rules for leap year:
'1. Leap Year is divisible by 4 (This is mandotory Rule)
'2. Leap Year is not divisible by 100 (Optional)
'3. Leap Year divisble by 400 (Optional)

Dim oYear

oYear=1996

If ((oYear Mod 4 = 0) And (oYear Mod 100 <> 0) Or (oYear Mod 400 = 0)) then
print "Year "&oYear&" is a Leap Year"
else
print "Year "&oYear&" is not a Leap Year"
End If

‘**************************************************************************
'45. 2nd Method
' Checking 29 days for February month in specified year
‘**************************************************************************
Dim oYear
Dim tmpDate

oYear=1996
tmpDate = "1/31/" & oYear
DaysinFebMonth = DateAdd("m", 1, tmpDate)

If day(DaysinFebMonth )=29 then
print "Year "&oYear&" is a Leap Year"
else
print "Year "&oYear&" is not a Leap Year"
End If


‘**************************************************************************
'46 Format Number to specified decimal places
‘**************************************************************************

Dim oNum
Dim DecimaPlacestobeFormat
oNum = 3.14159
DecimaPlacestobeFormat=2
print Round(oNum , DecimaPlacestobeFormat)


‘**************************************************************************
'47 Write a program to Generate a Random Numbers
‘**************************************************************************
'This script will generate random numbers between 10 and 20
Dim rStartRange
Dim rEndRange

rStartRange=10
rEndRange=20

For iCounter=1 to 10
print Int((rEndRange - rStartRange + 1) * Rnd + rStartRange)
Next

‘**************************************************************************
'48 Write a program to show difference between Fix and Int
'Both Int and Fix remove the fractional part of number and return the resulting integer value.
'The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number,
'whereas Fix returns the first negative integer greater than or equal to number.
'For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
‘**************************************************************************

print Int(99.8) ' Returns 99.
print Fix(99.2) ' Returns 99.
print Int(-99.8) ' Returns -100.
print Fix(-99.8) ' Returns -99.
print Int(-99.2) ' Returns -100.
print Fix(-99.2) ' Returns -99.


‘**************************************************************************
'49 Write a program to find subtype of a variable
‘**************************************************************************

Dim oVar
Dim oDatatypes
oVar="QTP"
oVartype=Typename(oVar)
print oVartype


‘**************************************************************************
'50 Write a program to print the decimal part of a given number
‘**************************************************************************
Dim oNum
oNum=3.123
oDecNum=oNum- int(oNum)
print oDec

‘**************************************************************************
'51 Moving / Renaming of Files to a different location.
‘**************************************************************************
Dim fso,f
Var_Path = "Source Path"
Var_NewPath = "Destination Path"
Set fso= CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Var_Path)
For Each file In f.Files
'SourcePath File Name Extention, Destination Path NewfileName Extension
fso.MoveFile Var_Path & "\" & DataTable("Old", dtGlobalSheet)&".doc", Var_NewPath & "\" & DataTable("New", dtGlobalSheet) &".doc"
DataTable.GetSheet("Global").SetNextRow

Next
Set f = Nothing
Set fso = Nothing

‘**************************************************************************
'52 List the Documents in a Excel for a given folder
‘**************************************************************************
Dim fso,f,i
Dim objexcel
Var_Path = "C:\Sudhindra\TestFolder"
Set fso= CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(Var_Path)
Set objExcel = CreateObject("Excel.Application")
objexcel.Visible = True
objexcel.Workbooks.add
i=2
objexcel.Cells(1, 1).Value = "File Name"
For Each file In f.Files

var_Name = file.Name
Var_Test = Instr(1, var_Name, ".doc") 'Only Saves Documents in a excel.
If Var_Test Then
var_Name = Split(var_Name, ".doc")
objexcel.Cells(i, 1).Value = var_Name(0)
i = i + 1
End If

Next
objexcel.ActiveWorkbook.SaveAs(Var_Path & "\Files.xls")
objexcel.Quit
Set f = Nothing
Set fso = Nothing
Set objexcel = Nothing