get popup default text
Retrieve the default text of the user-entry field of one or more recent prompt popups.
Name | Description | Type | Modifier |
---|---|---|---|
message | Identifying message text of prompt popup(s) of interest. | String | None |
variable, variable2, variable3,…, variableN | (Optional) Names of one or more variables to receive the returned default text displayed in corresponding prompt popups (See ). | String | None |
The default text of the user-entry field of one or more recent prompt popups.
This action may be used within the following project items: test modules and user-defined actions.
Example - Case 1: A single popup
Scenario: You are testing a customer information page with a button, Sign up, used for submitting one's name:
- Upon clicking the button, a prompt appears with one input field and two buttons: OK and Cancel.Notes:The prompt popup displays the fields:
- Message: Please enter your name
- Default text: Joe Doe
- The test enters a new input value, e.g.
Jane Doe
, and then clicks OK to proceed. - The test then verifies the default text of the prompt popup based on a given message.
text
enter text on next popup Jane Doe
 
window control
click home sign up
 
message variable
get popup default text {Please enter.*} >>msg prompt
 
clear popup queue
Example - Case 2: A sequence of multiple popups
Scenario: You are testing an email registration page, with a button, Sign up, used for submitting a new email address:
- Upon clicking the button, a prompt popup appears with one input field and two buttons: OK and Cancel.Notes:This first prompt popup displays the following:
- Message: Please enter your email address
- Default text: [email protected]
- An invalid email address is entered (e.g.
Doe
), and then OK is clicked to proceed. - An alert popup is triggered to notify user of the invalid email address. It has one button, OK.
- The test clicks OK in the alert to dismiss it and proceed.
- An additional prompt popup appears emphasizing the need for a valid email address.Notes:This second prompt popup displays:
- Message: Please enter a valid email
- Default text: [email protected]
- A valid email address, e.g.
[email protected]
, is now entered, and OK clicked. - The test then verifies the following default texts:
- The default text of the prompt popup whose message is Please enter a valid email.
- The default text of the prompt popup whose message is Please enter your email address. (Hint: We can retrieve both default texts in a single action call by specifying prompts whose messages begin with the string
Please enter
)
text
enter text on next popup Doe
 
button
click on next popup OK
 
text
enter text on next popup [email protected]
 
window control
click home sign up
 
message variable
get popup default text Please enter a valid email >>msg reenter prompt
 
message variable
get popup default text Please enter your email address >>msg prompt
 
message variable variable2
get popup default text {Please enter.*} >>msg reenter prompt popup >>msg prompt popup
 
clear popup queue
- message argument:
- If no value is provided in this argument, any prompt without a message is considered a match.
- For added flexibility, wildcards may be used in this argument. For example: given a message argument with value of
{Please reenter your.*}
, TestArchitect searches for prompt popups whose message beginnings match the string Please reenter your. (See above)Tip:In more general terms, this argument accepts regular expressions.
- variable argument:
- For convenience, the argument headers variable, variable0 and variable1 are all used to reference the same item (that is, the default text of the most recent matching prompt popup).
- Numbers appended to the variable arguments reference only prompts in the recent popup history that have messages matching the contents of the message argument. Any other prompts, for the purposes of the current action, are ignored. The numbers correspond to the reverse order in which those popups were handled. Hence, variable references the most recently handled prompt popup satisfying the message text, variable2 the second most recent, and so on (See above).
- In cases where multiple recent prompt popups satisfy the contents of message, a single call to this action can retrieve any or all of the respective default text strings. Specify as many variable arguments as there are texts you wish to retrieve, taking care to number them in correspondence with the specific matching prompts (See above).
- If the variables in arguments variable, variable2, variable3, etc have not been declared, the action creates them as globals.
- This action supports the <ignore> modifier. If the string
<ignore>
is present as the value of any of the arguments, or any argument contains an expression that evaluates to<ignore>
, the action is skipped during execution.