Professional Documents
Culture Documents
Vb. Script Q. Variable Creates in 3 Types of Keywords?
Vb. Script Q. Variable Creates in 3 Types of Keywords?
SCRIPT
Private: a variable will be to the block hold; apart from that block cant be used.
Variables: it is a name given to a memory location, which can hold a value and that can be
changed any no.of times in future if required.
Declaration variables: in VB script one can declared a variable using the following key words.
Option explicit: this statement restricts the usage of new variable in a program without
declaration.
Procedures: it is a set of reusable expenses to perform a specific task; procedure can be called
any no.of times in the same text / multiple texts.
i. function procedure
Function procedure & sub procedure can accept the values but function procedure only can
return a value.
Page 1
Sub procedure will execute more faster than function procedure
So whenever the procedure no need to return any value then it is better to use sub procedure
gather then sub procedure.
METHODS
1.Capture Bit map: It is used for capturing a snapshot of an object during the execution &stores
it in the desired location.
Syn: window(flight reservation).captured bitmap path of the location with a file name
.bmp extension
2. Exist Method: It is used for checking the objects is existing or not. If at all the object is
existing then it will return true and allows the QTP for further execution. If at all the object is not
existing then it will wait till the object exist, soon after the object exist then it will return true and
allows the QTP for further execution. If at all the object does not exist even after the maximum
time is specified than finally it will return falls and allows the QTP for further execution.
Syn: var= window(flight reservation).exist (12) msg box var
3. Wait property: it is used for making the tool to wait based on the object properties value are
up to the maximum time.
Syn: Object hierarchy.Wait property(property name)., property value, extra time in
milli seconds.
4. Wait: wait statement is used for making the tool time is wait till the specify time is elapsed.
Edit box: it is used for setting any value into the object box
Check box: set method is used for selecting and de selecting the checkbox
Radio Button: set method is used for selecting a radio button in a group
Page 2
8. Activate method: it is used for activating a dialog or a window
Type: it is used for making the QTP perform some keyboard related operation
Set secure: it is used for setting the encrypted data into an edit box.
9. Set secure: it is used for setting the encrypted data into an edit box.
10. to generate the encrypted string QTP has Provide a special tool by name password encoder:
11. Get RO Property: Runtime Object used for getting the runtime object properties value
during the execution.
12. Get TO property: Text Object used for getting the TO property value during the execution.
13. Set Text object: it is used for setting the text object property value temporally during the
execution
Upper case: it is used for converting any String into Upper case
Page 3
Lower case: it is used for converting any String into Lower case
Data table method: data table methods are used for performing the operation on the runtime
data table during the execution.
Add sheet: it is used for an extra sheet to the runtime data table
Syn: data table.add sheet sheet name
Delete sheet: it is used for a specified sheet from the runtime data
Syn: data table.delete sheet sheet name
Import: it is used for importing the data present in the excel file to the runtime data table
Syn: data table.import path of the excel file
Import sheet: it is used for importing a specific sheet of data from the excel file to a specify
sheet of Data in the runtime data type.
Syn: data table.import sheet path of the excel file
Export: it is used for exporting the completing data present in runtime data table to an excel
file
Syn: data table.export path of the excel file
Export sheet: it is used for exporting a specify sheet of data file to an excel file
Syn: data table.export sheet path of the excel file
Set current row: it is used for making the QTP focus on a specified row
Syn: data table.Set current row
Set next row: it is used for making the QTP focus on the next row of the currently focusable
Syn: data table.next row
Set previous row: it is used for making the QTP focus on the previous row of the currently
focus row
Syn: data table.Set previous row
Get sheet: this method is used for making the QTP focus on a specified sheet
Syn: data table.Get sheet
Page 4
Get row count: It is used for getting the row count of a specified sheet. By default it will get the
row- count of global sheet. If required we need to first focus the required sheet and than get
the row count.
Syn: data table.get rowcount
Value: it is used for getting a value from a specified sheet, specified column and current focused
Row.
Syn: data table.value
Input Output parameters: it is a concept provided by QTP used for passing the values into
the action and returning the values from the action.
Depending upon the no.of values to be passed into the action that many no.of input parameter
need to be declared, depending upon the no.of values need to be return from the action that many
no.of output values need to declare.
Navigation for declaring Input and Output parameter:
Activate the menu edit
Go to action
Select the option action properties
Select the parameter tab declare the desire no.of I/p O/p parameters
Click on ok
Page 5