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.
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
Parameter |
Description |
---|---|
prompt=value; |
The text string displayed in the message dialog box. To include a line break within a text string, use <NL>. For example: prompt=Newline Message Prompt!!<NL>Line1<NL>Line2<NL>Line3 Creates the following text string:
|
title=value; |
The text string displayed in the title bar of the message dialog box. |
ret=&variable; |
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
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.
Type |
Action |
Recognition |
Parameters |
Value |
---|---|---|---|---|
Variable |
Set_Value |
&TestStep |
|
Manually drag and drop |
Variable |
Set_Value |
&Prompt |
|
Was manual test successful? |
MsgBox |
YesNo |
prompt=&Prompt;title=&TestStep;ret=&ret |
||
Conditional |
If_Then |
&ret=6 |
|
|
Log |
Pass |
Manual step &TestStep Passed |
|
|
Conditional |
Else |
|
|
|
Log |
Message |
Manual step &TestStep Failed |
|
|
Conditional |
End_If |
|
|
|
Based on the test steps in the example above, the message box is created.
