Terminal - Wait
Declaration
<AMWAITFORTERMTEXT SESSION="TermSess1s" TIMEOUT="number" MEASURE="text (options)" USECASE="YES/NO" USERE="YES/NO" FOUNDTEXTVARIABLE="text" TYPE="TEXT">theText</AMWAITFORTERMTEXT>
Description: Causes task execution to pause at the current step until the condition to wait for ensues.
Practical Usage
A delay mechanism commonly used to suspend execution until a condition takes effect indicating the terminal is ready for the next step. Use this activity if the terminal requires you to wait until it completes a process or operation.
General Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Wait for |
Text (options) |
No |
Text to appear |
TYPE="BLANKSCREEN" |
Specifies the condition to wait for. The available options are:
|
Text |
Text |
Yes |
(Empty) |
>text</AMWAITFORTERMTEXT> |
The text that is to appear or disappear. Only valid if Text to appear or Text to disappear is the selected Wait for option. |
Regular Expression |
Yes/No |
No |
No |
USERE="YES" |
If set to YES, specifies that the value entered in the Text parameter is a regular expression. If set NO, specifies that the Text parameter contains literal text. This parameter is set to NO by default. |
Case Sensitive |
Yes/No |
No |
No |
USECASE="YES" |
If set to YES, specifies that the value entered in the Text parameter is case sensitive. If set NO, the Text parameter is case insensitive. This parameter is set to NO by default. |
Cursor Row |
Number |
No |
(Empty)
|
ROW="1" |
Indicates the row number for the cursor position to wait for. This parameter is available only if the Wait for parameter is set to Cursor moved to or Cursor moved out of. |
Cursor column |
Number |
No |
(Empty) |
COLUMN="2" |
Indicates the column number for the cursor position to wait for. This parameter is available only if the Wait for parameter is set to Cursor moved to or Cursor moved out of. |
Timeout |
Number |
No |
5000 |
TIMEOUT="50" |
The number of milliseconds, seconds, minutes, or hours that this step should wait before timing out. The value entered corresponds to the time scale selected in the Measure parameter below. |
Measure |
Text (options) |
No |
Milliseconds |
MEASURE="seconds" |
The time scale that corresponds to the value entered in the Timeout field. The available options are:
|
Session name |
Text |
No |
TermSess1 |
SESSION="TermSess1s" |
The session name to associate with this action. This session name must have been previously created with a prior Connect Terminal step. This allows several connections to be active simultaneously. The default value is TermSess1. |
Advanced Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Populate variable with found text |
Text |
No |
(Empty) |
FOUNDTEXTVARIABLE="VariableName" |
Indicates the name of an existing variable in which to populate with the found text. This parameter is available only if the Wait for parameter is set to Text to appear or Screen to contain text. |
Examples
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Sample 1: This sample step waits for the text "Wait for this text to appear" to appear in terminal session "TermSess1s." Use case sensitivity. Wait times out after 10 seconds.
<AMWAITFORTERMTEXT SESSION="TermSess1s" TIMEOUT="10" MEASURE="seconds" USECASE="YES" USERE="YES" FOUNDTEXTVARIABLE="theVar" TYPE="TEXT">Wait for this text to appear.</AMWAITFORTERMTEXT>
Sample 2: A sample task that uses all available terminal actions. Examining the step parameters and properties of this task may assist you in creating your own terminal emulation task.
<AMVARIABLE NAME="thePassword">password</AMVARIABLE> <AMCONNECTTERM EMULATION="VT220" HOST="linux.networkautomation.com" SHOWTERMINALWINDOW="YES" /> <AMWAITFORTERMTEXT TYPE="TEXT">login:</AMWAITFORTERMTEXT> <AMSENDTERMTEXT>%theUsername%{ENTER}</AMSENDTERMTEXT> <AMSHOWDIALOG>OK to proceed?</AMSHOWDIALOG> <AMWAITFORTERMTEXT TYPE="TEXT">Password:</AMWAITFORTERMTEXT> <AMSENDTERMTEXT>%thePassword%{ENTER}</AMSENDTERMTEXT> <AMSHOWDIALOG>OK to proceed?</AMSHOWDIALOG> <AMDISCONNECTTERM />