Wednesday, 9 May 2012

Input And Output Operations in QTP

Am going to explain some of the input and output functions used in Test Automation script which will be useful in debugging the script as well as giving the input dynamically at run time.

InputBox Function:
This function is used to give the user input at run time.The behavior will be,
01.Displays a prompt will be displayed in a dialog box.
02.Waits for the user input text/click.
03.Returns the content of the text box.

Example:
Dim input
input=InputBox("Enter your name:")
MsgBox("You Entered:" & input)

MsgBox Function:
This function is mainly useful when debugging the script.The behavior will be,
01.Displays a message in dialog box.
02.Waits for the user to click a button
03.Returns a value indicating which button the user clicked.

Example:
Dim output
output =MsgBox("Hello World!",70,"MsgBox Example!")
Output variable contains either 1 or 2 depending on which button is clicked.

0 comments:

Post a Comment

 
Back To Top