Tags:
tag this topic
create new tag
view all tags
---+ Using the APPX/TMUNIX Scripting Feature *The following information is only applicable when running APPX in character mode (ie, not using the APPX Desktop or HTML clients) or using the old Presentation Manager client (ie, running 'appx.exe -c' to connect to a remote server or running 'appx.exe' directly on the server).* Appx now uses the following environment variables to control the Appx scripting feature: <blockquote dir="ltr" style="margin-right: 0px;"> APPX_TST_DIR<br /> APPX_SCRIPT_IN<br /> APPX_SCRIPT_OUT </blockquote> <p dir="ltr">The scripting feature recognizes scripts of the following form:</p> <p dir="ltr">(This script will enter application design, traverse to input process definition, muck around a little, then exit.)</p> <p dir="ltr">! <br /> ! APPX MENU <br /> #USER 2<br /> ! APPLICATION DESIGN<br /> TST10<br /> #RETURN<br /> #USER 2<br /> ! PROCESS MANAGEMENT<br /> #USER 3<br /> ! PROCESS (INPUT)<br /> #CURSOR DOWN<br /> #CURSOR DOWN<br /> #CURSOR RIGHT<br /> #CURSOR RIGHT<br /> #DELETE PREV CHARACTER<br /> #DELETE PREV CHARACTER<br /> # RETURN<br /> ! FRAME (INPUT)<br /> #END<br /> ! PROCESS (INPUT)<br /> #END<br /><br />Blank lines and lines beginning with an exclamation point (!) are treated as comments (and ignored). Lines beginning with a pound sign (#) are considered to be the names of Appx options. Any other lines are considered literal text which is provided to Appx as if the user had entered the characters at the keyboard.</p> <p dir="ltr">You can substitute environment variables into a script using "#$name" where "name" is the name of an environment variable. You can use this as a way to automate repetitive tasks such as data file management. For example, given the following script:</p> <p dir="ltr">! Filename: restruct.apx<br />!<br />! Restructure a database/application<br />! set $ap to the name of the application<br />! set $db to the name of the database<br />!<br />#USER 4<br />#$db<br />#$ap<br />#RETURN<br />#USER 4<br />#END<br />#END<br />#END</p> <p dir="ltr">You could restructure a database/application with the following Unix command line:</p> <blockquote dir="ltr" style="margin-right: 0px;"> <p dir="ltr">$ APPX_SCRIPT_IN=restruct.apx ap=TAR db=MDB appx</p> </blockquote> <p dir="ltr">Of course the easiest way to build this script would be to record the keystrokes and then edit in the environment variables for the text you want to replace.</p> <p dir="ltr">NOTE: Because comments start with a "!" and options start with a "#", you will NOT be able to record/playback any strings which start with either of those characters. If the playback facility finds an option line which is doesn't understand (such as #NONSENSE), it will play back a #CANCEL instead. If you must record a string that begins with a "#" or a "!", begin the string with a junk character and then go back<br />and delete the character.</p> <h5 dir="ltr">APPX_SCRIPT_OUT</h5> <p dir="ltr">If the APPX_SCRIPT_OUT environment variable is defined, Appx will use the file named by that variable to record keymap independent keystrokes. As each option is entered by the user, Appx records the option name in the output script file. Non-option keystrokes are echoed to the script file. Appx will also record the current process name so that script files are (reasonably well) documented and more easily maintained.</p> <h5 dir="ltr">APPX_SCRIPT_IN</h5> <p dir="ltr">If the APPX_SCRIPT_IN environment variable is defined, Appx will use the file named by that environment variable as the source of input. Appx options and literal text will be read from the input script file. If the input script file becomes exhausted, Appx will<br />begin reading from stdin.</p> <h5 dir="ltr">APPX_TST_DIR</h5> <p dir="ltr">If the APPX_TST_DIR environment variable is defined, Appx will record screen dumps into files in that directory. Appx will create two subdirectories called:</p> <p dir="ltr">$APPX_TST_DIR/expect</p> <p dir="ltr">$APPX_TST_DIR/actual</p> <p dir="ltr">If Appx is recording a script (because the APPX_SCRIPT_OUT environment variable is set), Appx will record screen dumps into the $APPX_TST_DIR/expect directory, otherwise, Appx will record screen dumps into the $APPX_TST_DIR/actual directory. The screen dumps are editable ascii files whose names are of the form screen001, screen002, etc.. Appx will record screen dumps each time an interceptable Appx<br />option is recorded (or played back).</p> <p dir="ltr">Also, if APPX_TST_DIR is defined, the normal time/date display is suppressed so that screen dumps will not be time sensitive.</p> <p dir="ltr">The APPX_SCRIPT_IN, APPX_SCRIPT_OUT, and APPX_TST_DIR environment variable can be used in any combination.</p> <p dir="ltr"> </p> | APPX Script In | APPX Script Out | APPX TST DIR | | | SET | | | Playback, no screen dumps | | | SET | | Record, no screen dumps | | | | SET | Input comes from keyboard,dump screens | | SET | SET | | Playback & record (annotates script w/proc names) | | SET | | SET | Playback & dump screens (Regression test) | | | SET | SET | Record and dump screens (record a test) | | SET | SET | SET | Playback, record, dumps screens (why bother?) | <pre dir="ltr"> </pre> <p dir="ltr">The most useful combinations are the "record a test" and the "regression test" cases. A regression test is built by record the script and screen dumps (into $APPX_TST_DIR/expect) to establish the baseline screens.</p> <p dir="ltr">A regression scenario is tested by playing back the script, capturing the screen dumps (into $APPX_TST_DIR/actual), then "diff"ing the expect and actual directories. The 'diff' command can take two directories as arguments in which case it compares each file in the two directories, therefore the command "diff expect actual" can be used to verify a run of a regression test.</p> <h5 dir="ltr">APPX_SCRIPT_STEP</h5> If the environment variable APPX_SCRIPT_STEP is not blank in script playback mode, APPX will pause before each option key is played. You must press a key to resume until the next APPX option key is to be sent. While paused, you can suspend the script, take over control of the keyboard and then resume the script.<br />While paused, you can press the following keys: c continue running the script without stepping <br />p pause, you take over the keyboard until you hit OPT_MACRO (Ctrl-R). <br />e end the script Anything else will step through the script until the next Option would be played ---++ Comments: _Read what other users have said about this page or add your own comments._ --- <br />%COMMENT%
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r3 - 2016-02-18
-
JeanNeron
Home
Site map
Main web
MedicaidBilling web
Sandbox web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback