Launching a control with scenarioPlayer

A control corresponds to the execution of a test scenario by scenarioPlayer.fmw. Each control launches the processing and ensures the verification of the various tests of the scenario and then generates a report which is time-stamped.

We recommend using scenarioPlayer from the command line or better from a .bat or .sh file (See tutorial examples)

Although scenarioPlayer.fmw is an FME project, we do not recommend launching it from the FME Workbench. The file is password protected to avoid this kind of use. However, the project is still accessible to developers for study, debugging, or modification purposes from the "Developer Resources" section of the documentation.

Command line usage

The general syntax is as follows:

chemin_vers_fme chemin_vers_scenarioPlayer.fmw --parametre1 "valeur du paramètre 1" --parametre2 "valeur du paramètre 2"

For example:

C:\fme.exe "C:\rtest\scenarioPlayer.fmw" --scenarioxml "C:\monprojet\sc_HelloWorld.xml"  

Use in a command file

The syntax is the same as on the command line but it is easier to use a relative path to the tests scenario by defining the home directory.

Example of a .bat file under Windows :

@ECHO OFF
CHCP 65001
cd %~dp0
ECHO Répertoire de travail : %CD%
fme.exe ..\..\scenarioPlayer.fmw --scenarioxml "./sc_HelloWorld.xml" --user "Frédéric"
  • CHCP 65001. This command (optional) allows to use the utf-8 code page of Windows and thus to enter accented characters in a .bat file. For example "Frédéric".

  • cd %~dp0. This command must be used if you run the .bat file in a graphical environment from a double click. It sets the directory containing the .bat document as the working directory. This allows you to use a relative path to locate scenarioPlayer.fmw

Note

It is important to understand the use of the working directory by the scenarioPlayer. This is described in the Working Directory and Result Location section of the documentation

List of published parameters of scenarioPlayer.fmw

scenarioxml

  • Description: Full path to the test scenario in XML format.

  • Expected value: A string. The location must be absolute or relative to the current working directory. The characters \ or / can be used to separate directories.

  • Default value: No default value, this parameter is mandatory.

userdestdir [Optional]

  • Description: Location of the directory containing the control results, i.e. the rtlog, rtcontrol and rtreport subdirectories. Use this parameter to force the result to be written to a specific directory.

  • Expected value: A string. The location must be absolute or relative to the test scenario. The characters \ or / can be used to separate directories.

  • Default value: Empty string. In this case the result is stored in the working directory, i.e. the directory of the test scenario.

fmedir [Optional]

  • Description: Location of the directory containing the FME Desktop engine to be used for running the scenario FME processes. Use this parameter if you want to run a different instance of FME for scenarioPlayer and for the FME processes described in the scenario processes. For example, to use an instance older than FME 2019.

  • Expected value: Path to the directory containing the fme.exe (Windows) or fme (Linux) executable. The characters \ or / can be used to separate directories.

  • Default value: Empty string. In this case the FME instance used to run the FME processes is the same as the one used for scenarioPlayer.

user [Optional]

  • Description: Name of the user launching the control. This value will appear in the html report next to the "User" label.

  • Expected value: A string.

  • Default value: Empty string.

rtestlist [Optional]

  • Description: List of test identifiers to run. Use this parameter to run only certain tests in a scenario that has several tests. This practice can be useful during debugging to reduce execution time. Be careful, partial execution can modify the logic of a scenario and produce different results than a complete execution.

  • Expected Value: Comma separated list of test identifiers. The test identifiers are defined in the id attribute of the rtest elements in the XML scenario, for example: \rtest id="hw.t1">

Example of rtestlist parameter value:

--rtestlist "hw.t1,hw.t2"
  • Default value: Empty string. In this case, all tests are executed.

output

  • Optional parameter

  • Description: Type of result produced by the control: html report, raw data in json format or both.

  • Expected value: Three values are possible, case sensitive: html: generates only an HTML report in the ./rtreport subdirectory json: generates only a JSON document in the ./rcontrol subdirectory html+json: generates the HTML report and the JSON document in their respective subdirectories.

Note that log files are always generated in the ./rtlog subdirectory, regardless of the value of the output parameter.

  • Default value: html.