One Testing Center

QTP - Keyword Driven Framework. QTP Learning Book - Learn By Questions. QTP Learning Book - Made Easy - Part1. QTP Learning Book - Made Easy - Part2. QTP Quality Center - QC.

QTP - Frameworks

QTP - Frameworks. Record and Play back Framework. Action Driven Framework. Data Driven Framework. Functional Decomposition Framework. Keyword Driven Framework. Hybrid Framework. Test Driven Framework.

QTP - Automation

QTP - Basics. QTP - Intermediate. QTP - Advanced. QTP - Frameworks.

QTP - Training

Friends, Welcome to OneTestingCenter. I am HP Functional Test ExportOne. I am HP Automation Functional Test Certified Professional. I am certified for HP Functional Test 11.x. Happy to share my knowledge.

QTP - Books

QTP - Keyword Driven Framework. QTP Learning Book - Learn By Questions. QTP Learning Book - Made Easy - Part1. QTP Learning Book - Made Easy - Part2. QTP Quality Center.

Recent Post

QTP @ MsgBox


MsgBox – Message Box

  • MsgBox
  • MsgBox(prompt, buttons, title, helpfile, context)
  • Prompt : The text of the message to display in the message box dialog.
  • Buttons :The sum of the Button, Icon, Default Button, and Modality constant values.
  • Title : The title displayed in the Title-bar of the message box dialog.
  • Helpfile :An expression specifying the name of the help file to provide help functionality for the dialog.
  • Context : An expression specifying a context ID within helpfile.


MSGBOX – Buttons

Constant
Value
Description
vbOKOnly
0
Display OK button only.
vbOKCancel
1
Display OK and Cancel buttons.
vbAbortRetryIgnore
2
Display Abort, Retry, and Ignorebuttons.
vbYesNoCancel
3
Display Yes, No, and Cancel buttons.
vbYesNo
4
Display Yes and No buttons.
vbRetryCancel
5
Display Retry and Cancel buttons.
vbCritical
16
Display Critical Message icon.
vbQuestion
32
Display Warning Query icon.
vbExclamation
48
Display Warning Message icon.
vbInformation
64
Display Information Message icon.
vbDefaultButton1
0
First button is default.
vbDefaultButton2
256
Second button is default.
vbDefaultButton3
512
Third button is default.
vbDefaultButton4
768
Fourth button is default.
vbApplicationModal
0
Application modal; the user must respond to the message box before continuing work in the current application.
vbSystemModal
4096
System modal; all applications are suspended until the user responds to the message box.

MSGBOX – Return values

Constant
Value
Button
vbOK
1
OK
vbCancel
2
Cancel
vbAbort
3
Abort
vbRetry
4
Retry
vbIgnore
5
Ignore
vbYes
6
Yes
vbNo
7
No




Msgbox – demo

ž  Example:
      sMsg = "This is line 1" & vbNewLine & "This is line 2"
      MsgBox sMsg
      MsgBox "Hahaha...I am just laughing..Just like that :):)"
     
      MsgBox "Hahaha...I am just laughing.." & vbNewLine & "Just like that :):)“
      MsgBox ("All Done")
MyVar = MsgBox ("Hello Friend",0, "QuickTest QTP @ GAReddy")
MsgBox MyVar
MyVar = MsgBox ("Are you really interested?",3, "QuickTest QTP @ GAReddy")
MsgBox MyVar

'vbYesNoCancel

MyVar = MsgBox ("Are you really interested?",vbYesNoCancel, "QuickTest QTP @ GAReddy")
MsgBox MyVar
  • var=MsgBox("Hiiiiiiiiiii",4,"GAReddy")
  • msgbox var
  • MyVar = MsgBox ("Hello Friend",0, "QuickTest QTP @ GAReddy")
  • MsgBox MyVar
  • MyVar = MsgBox ("Are you really interested?",3, "QuickTest QTP @ GAReddy")
  • MsgBox MyVar
o   'vbYesNoCancel
o   MyVar = MsgBox ("Are you really interested?",vbYesNoCancel, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",256, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",512, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",768, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",0, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",4096, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",64, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",48, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar

QTP @ InputBox


  • InputBox Function
    • The InputBox function displays a dialog box containing a label, which prompts the user about the data you expect them to input, a text box for entering the data, an OK button, a Cancel button, and optionally, a Help button. When the user clicks OK, the function returns the contents of the text box.
  • InputBox(Prompt, Title, Default, Xpos, Ypos, HelpFile, Context)
  •   MsgBox Function
    • Displays a dialog box containing a message, buttons, and optional icon to the user. The action taken by the user is returned by the function as an integer value.
o   InPutBox
  • Syntax
  • InputBox(prompt,title,default,xpos, ypos, helpfile, context)
  • Description
  • Prompt: The message in the dialog box.
  • Title :The title-bar of the dialog box.
  • Default : String to be displayed in the text box on loading.
  • Xpos : The distance from the left side of the screen to the left side of the dialog.
  • Ypos : The distance from the top of the screen to the top of the dialog box.
  • Helpfile : The Help file to use if the user clicks the Help button on the dialog box.
  • Context : The context number to use within the Help file specified in helpfile.

o   InputBox - demo
  • Example:
o   YourName=InputBox("What's Your Name","Name Box", "MyName")
o   MsgBox YourName
o   MyAddress = InputBox("Enter your Address", , "Something", , , "help.hlp", 321321)
o   MsgBox MyAddress

  • Example:
o   Option Explicit
o   Dim sPrompt, sTitle, sHelpFile, sRes
o   Dim vDef
o   Dim nYPos, nXPos, nContext
o   sPrompt = "Where do you live?" : sTitle = "Personal Data"
o   vDef = "INDIA"
o   nXPos = 100 : nYPos = 100 : nContext = 1001
o   sHelpFile = "C:\WINDOWS\system32\winhelp.hlp"
o   sRes = InputBox(sPrompt, sTitle, vDef, nXPos, nYPos, sHelpFile, nContext)
o   MsgBox sRes

GAReddy @ OneTestingCenter @ All Articles