Commands

From Autodrive
Revision as of 09:55, 28 February 2013 by Hjortskov (Talk | contribs) (Created page with "'''Basic commands''' The driver uses a handful of simple control commands. ===LOAD:<filename relative to project root folder>=== This instruction tells the driver to load a...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Basic commands

The driver uses a handful of simple control commands.

LOAD:<filename relative to project root folder>

This instruction tells the driver to load an automation script.

Example:

  1. somescripttoexecute.tc
    1. LOAD:scripts/minscript_1.tc
    2. LOAD:scripts/minscript_2.tc
    3. LOAD:scripts/minscript_3.tc

RETURN:=

This inctruction is especially useful when debugging a script because it instructs the driver to stop loading more commands from the script currently under execution.

Example:

  1. someotherscripttoexecute.tc
    1. LOAD:scripts/minscript_1.tc
    2. command 2:
    3. RETURN:
    4. command 3:
    5. EXIT:

Here executed steps are 1, 1.1, 1.2, 1.3, and 2. Thus command 3: and EXIT: are left out.

EXIT:

This instruction tells the driver to not only stop executing from this point on, but furthermore, to stop the automation thread too. This might also be handy during script debugging.

SLEEP:<time_in_milliseconds>

Instructs the driver to wait for the provided time in milliseconds.

SLEEP:120000

120000 milliseconds equals 5*60*1000, resulting in a 5 minuts wait.

PAUSE:<text>

Instruction that tells the driver to stop waiting for user signal to continue. Please note that no input eventually will conflict with the overall driver timeout.

PAUSE:Push a button to continue...

Pressing the <enter> button makes the script continue.

TIMEOUT:<seconds>

Instruction for overriding the default timeout, which is 10 minutes or 600 seconds. The timeout can be seen as the execution window for each command. When a timeout occurs, the report will show this as an INTERRUPT state and a orange breadcrum trace.

Script and report descriptions

Every command can be preceded by a description block. It is suggested to used it and to spend some time on writing meaning full description which will make it a lot easier to interpretate the final report.

/*
 * This is a comment which will go into the html report.
 * and it can span multiple lines
*/

SCRIPT:<type>

This instruction tells the driver that it meets an advanced command that needs to be interpritated as some language type.

Several types are supported, please refer to BSF version 2.4. It is recommended to pick one scripting type and stick to that. This way reuse is enforced. The author of the autodriver uses javascript (Rhino implementation) and thus examples are often in JavaScript.

SCRIPT:javascript END-SCRIPT

This example will just execute an empty advanced command.

File formats

Script files should be encoded as ansi or ISO-8859-1.

Help

The driver and its plugins can show command syntax if implemented.

Use either the command ?: or ?:<plugin>.