Skip to Main Content
Return to Navigation

MsgBox

Use the MsgBox step to insert manual steps in your test for steps that cannot be automated in PTF. For example, if your test includes a step to drag and drop on a page, you will not be able to automate the drag and drop feature. By using the MsgBox step, the message will be displayed allowing the user to perform the action manually, once the user dismisses the message box PTF execution will continue.

All of the actions associated with MsgBox step type use the same parameters.

Actions for MsgBox Step Type

The following actions are associated with the MsgBox step type, all of the actions use the same parameters.

Action

Description

AbortIgnoreRetry

Creates a message box that contains 3 buttons- Abort, Ignore, and Retry.

OKCancel

Creates a message box that contains 2 buttons- OK and Cancel.

OKOnly

Creates a message box that contains 1 button- OK.

RetryCancel

Creates a message box that contains 2 buttons- Retry and Cancel.

YesNo

Creates a message box that contains 2 buttons- Yes and No.

YesNoCancel

Creates a message box that contains 3 buttons- Yes, No, and Cancel.

Parameters

prompt=value

The text string displayed in the message dialog box.

tilte=value

The text string splayed in the title bar of the message dialog box.

ret=&MyBtnClick

The variable name that will store the integer indicating which button the user clicked.

Return Values

The return value is based on the button that was pressed by the user during test execution:

Button Pressed

Return Value

OK

1

Cancel

2

Abort

3

Retry

4

Ignore

5

Yes

6

No

7

Example

Image: Example of MsgBox Steps

In this example variables are created to store the text for the prompt and title. The message box is created as a YesNo message box. If the Yes button is pressed by the user, the return value will be 6.

Example of MsgBox Steps

Image: Example of the Message Box displayed in test execution

Based on the test steps in the example above, the message box is created.

Example of the Message Box displayed in test execution