delay duration message text sequence text shell command setenv env-var env-value breakpoint widget exit status
delay allows you to insert a pause in a script. This is useful when you wish to visually inspect the application at particular points in its execution. The next action in the script will continue after the pause.
message displays a message on standard error. This allows you to label different parts of the script and communicate expected results and errors to testers. The message text does not have to be enclosed in quotes.
sequence is used to label different sections of a script. Then if an error occurs, you can skip to the next labelled sequence and continue from that point.
To use sequence, you must invoke xdreplay with the skiponerror flag. By default, xdreplay is run with the useronerror flag which will stop the test and stay in the application when an error occurs. The remaining error flag, exitonerror causes will terminate the application when an error occurs.
shell executes a shell command from a script. The script continues when the shell command has terminated. This facility allows you to enrich your scripts to do far more than simply re-running user actions.
setenv is used in conjunction with the shell command to pass information to the shell through environment variables. setenv has two arguments. The first is the name of the variable; the second is an expression that can combine widget resource values and one of the following convenience functions:
breakpoint is used, in conjunction with a debugger, to set a breakpoint in a script when a nominated widget is activated. You can then examine the internals of individual widgets.
A script which contains the breakpoint keyword should be invoked as follows:
xdreplay -f script debugger app
where script is the name of the script, debugger is the name of your debugger and app is the name of the application to be exercised by the script. The debugger is run by X-Designer Replay. At the breakpoint keyword, the application will stop as if you set the breakpoint directly. This will allow you to inspect widget internals even if your application has been optimized.
exit terminates the script with the specified exit status.
To delay for 5 seconds after pushing a widget:
in ApplicationShell push mywidget delay 5 push yourwidget
To take a screen dump of a shell without window manager decorations:
in ApplicationShell setenv ID WindowId(ApplicationShell) shell xwd -id $ID -out /tmp/shell.xwd
To take a screen dump with window manager decorations:
in ApplicationShell setenv ID WindowFrame(ApplicationShell) shell xwd -id $ID -out /tmp/shell.xwd
To take a screen dump of a pulldown menu, when you only know the name of its cascade button:
in ApplicationShell push cascade_button setenv ID WindowId(cascade_button->subMenuId) shell xwd -id $ID -out /tmp/shell.xwd
To do the same with an OptionMenu:
in ApplicationShell push option_menu.OptionButton setenv ID WindowId(option_menu->subMenuId) shell xwd -id $ID -out /tmp/shell.xwd
To note the background color of the cascade button's parent:
in ApplicationShell setenv ID Parent(cascade_button)->background shell echo The Color $ID
See also: