VNCRobot 1.3 CLI Options
SYNOPSIS
To run VNCRobot use one of the following commands. Note that the
wrapper scripts can't handle more than 9 parameters. If you need to pass
more parameters or customize the VNCRobot start command, use the command
with java.
Unix/Linux:
./vncrobot.sh [options]
java -classpath jh.jar:vncrobot.jar
com.vncrobot.VNCRobot
[options]
MS Windows:
vncrobot.bat [options]
java -classpath jh.jar;vncrobot.jar com.vncrobot.VNCRobot
[options]
OPTIONS
-h, --help
Display a shorter version of this help.
-c [server[:display]], --connect [server[:display]]
Connect to a VNC server, e.g.
'localhost', 'localhost:1' etc. The display number corresponds to the
port number on which your VNC server is running, :1 is port 5901, :2 is
5902 etc.. If no display number is provided, VNCRobot defaults to 0,
i.e. 'localhost' and 'localhost:0' are equivalent.
- Unix/Linux - Unix like systems running X-Windows can run multiple
window servers so the number of your display actually depends on the
number of VNC server instances running on your machine. If you for
example start the VNC server three times on a test machine called
mymachine
,
there will be three independent remote desktops available on mymachine:1
,mymachine:2
and mymachine:3
.
- MS Windows - Since Windows are not capable to run multiple window
servers (i.e. provide multiple displays), the VNC server always runs on
port 5900 and you may provide just the server name, e.g.
vncrobot.bat
-c mymachine
.
-p [password], --password [password]
Password to authenticate to the VNC
server. The server may or may not require it depending on its
configuration.
-v [variablename]=[value], --variable [variablename]=[value]
Override a script variable value. See
the documentation on the
Var
command. Variable values defined through this parameter will remain
unmodified for the whole time of script execution and they will override
any variable modifications done in the script. You may use this feature
to run the same script for different configurations.
-o [optionname]=[value], --option [optionname]=[value]
Redefine a user preference value.
Anything that is configurable via the Preferences dialog can be
redefined here. Any preference changes redefined this way will be
maintained only for the time of the script execution and they are not
written to the user configuration file. See the
VNCRobot default configuration file for
info about option names and acceptable values.
-r [filename], --run [filename]
Run a test script. The file name can be
either relative or absolute. This option can be used in both GUI and CLI
modes.
-n, --nodisplay
Do not display the VNCRobot GUI. This option can be used only with
the -r/--run
option to run a test script from a command line without any graphical
output. Running in CLI mode is faster and requires less memory and system resources. On Unix/Linux systems it
also allows to run automated tasks remotely from a terminal without a graphical display.
--createscript
[filename]
To be used when you execute VNCRobot in
GUI mode. The option will create a new script or overwrite an existing
one and open it in the editor.
--outputdir [path]
Initialize the output path of the
script created through --createscript
. The option will
create a variable 'Var _REPORT_DIR=<path>'
and insert
it into the script.
--templatedir [path]
Initialize the template path of the
script created through --createscript
. The option will
create a variable 'Var _TEMPLATE_DIR=<path>'
and
insert it into the script.
--autosave
Automatically save the script created
through --createscript
when you close the VNCRobot GUI.
--fromlabel [label]
Execute a script from a label specified
in the script code. A label is a script line starting with a colon ':'.
If your script e.g. contains a label ':start'
, then CLI
option '--fromlabel start'
will execute just the commands
after the label.
--tolabel [label]
Execute a script to a label specified
in the script code. A label is a script line starting with a colon ':'.
If your script e.g. contains a label ':end'
, then CLI
option '--tolabel end'
will execute just the commands
before the label.
--nooutput
Dry run - execute a script but don't
produce any output. If you specify this option, all
Screenshot and
Report commands will be
executed successfuly but they will not produce any files. This can be
used for debug purposes when you want to reexecute a script and avoid to
overwrite the previous results.
EXAMPLES
./vncrobot.sh --connect fox.vncrobot.com:2
Connect to a VNC server running on
machine fox.vncrobot.com on port 5902. If the server doesn't require any
authentication,
VNCRobot GUI starts and
displays the server desktop in the
VNC viewer.
If the server requires password, a login dialog gets displayed and user
has to provide a valid password.
Let's have a test script test.txt
:
# This script opens an application on GNOME
# We take advantage of the feature that Alt+F2 opens the Run
Application window
Var APPLICATION=""
Press Alt+F2 delay=5000
Typeline "{APPLICATION}" delay=5000
:screenshot
Screenshot application.png
Then commands:
vncrobot.sh -c fox.vncrobot.com:2 -p mypassword -r
test.txt -o
com.vncrobot.scripting.delayBeforeAutomaticExecutionSeconds=5 -v
APPLICATION=gnome-terminal
Connect to a VNC server running on
machine fox.vncrobot.com on port 5902 and start automatic execution of a
script called test.txt
in GUI mode. If authentication
succeeds and connection to the server gets established, the GUI gets
displayed and a timeout countdown is started. It will last 5 seconds
instead of the standard 15 secs because the parameter -o redefines the
timeout value. Once the time is out, execution of the script starts. As
the APPLICATION variable is redefined by the -v option, the script
starts a GNOME terminal window and take a screenshot. A shutdown
countdown of standard 15 seconds is then initiated. When the time is
out, the GUI gets disposed and VNCRobot exits.
vncrobot.sh -c fox.vncrobot.com:2 -p mypassword -r test.txt -o
com.vncrobot.scripting.delayBeforeAutomaticExecutionSeconds=5 -v
APPLICATION=gnome-terminal -n
This command should provide the same
result as the previous one except that no GUI gets displayed and
VNCRobot runs in the CLI mode.
vncrobot.sh -c fox.vncrobot.com:2 -p mypassword -r test.txt -v
APPLICATION=gnome-terminal --fromlabel screenshot
This command will execute just the 'Screenshot
application.png'
command because it is the only command after
the screenshot
label.