Skip to content

Launch Program Step

Martin Konopka edited this page Oct 20, 2019 · 12 revisions

Any program available on the computer can be launched in the session. There are mulitple ways to launch and close the program:

  • The program is launched on the foreground and immediately shown to the user. The step completes when the program is closed.
  • The program is launched on the background and kept running, this step completes immediately after the program is launched. To show the program to the user, the Show Desktop step must be explicitly used. This way, the program can run during mulitple timeline steps until it is explicitly closed using the Close Program Step, or by the user, or by the program itself.
  • The program is launched and runs in background, it is not shown to the user during the session.

Definition

  • actionType : "LaunchProgram" (required)
  • path : string - path to the program executable.
  • workingDirectoryPath : string - directory for the program to work in.
  • arguments : string - arguments to launch program with. They may contain arguments from session settings, each enclosed in curly brackets, e.g., "--username {user.name}" for using the participant's name specified in the answer name within the questionary user earlier in the session.
  • argumentsParameters : string[] - list of parameters used in the arguments field which should be replaced with their actual values, e.g., "user.name". If this field is omitted, the parameters in the arguments field are ignored and not replaced with their values.
  • runInBackground : boolean - specifies whether the program should be launched in the background, default value is false.
  • keepRunning : boolean - specifies whether the program should be left running even when the step completes. If set to true, such program must be closed with Close Program Step later in the session. To reference the program, use the same value in the tag field for both steps.
    • default value is false.
  • forceClose : boolean - specifies whether the program should be killed when the step completes. By default, the program is closed gracefully. But certain programs may not close immediately, e.g., waiting for user input ("Do you want to save changes?").
    • default value is false.
  • tag : string - keyword for identification of the launched program, can be used in the CloseProgram step.

Result

  • resultType : "Successful"

Example

Open Chrome web browser in Kiosk mode (fullscreen), navigate to the https://www.uxi.sk/ webpage. Step completion is allowed by pressing F10.

{
    "action": {
        "actionType": "LaunchProgram",
        "path": "c:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
        "arguments": "https://www.uxi.sk/ --kiosk"
    },
    "completion": {
        "hotkeys": [ "F10" ]
    }
}

Open Chrome web browser in Kiosk mode (fullscreen) and incognito, navigate to the custom website and pass it the participant's name through the URI parameter.

{
    "action": {
        "actionType": "LaunchProgram",
        "path": "c:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
        "arguments": "--kiosk --incognito \"https://mywebsite.domain/index.html?participant={Participant.Name}\"",
        "argumentsParameters": [ "Participant.Name" ],
        "tag": "browser"
    },
    "completion": {
        "hotkeys": [ "F10" ]
    }
}

The participant's name is retrieved in the preceding Questionary step. The arguments in parameter for the URI must match values in id fields of the questionary and question definitions.

{
    "action": {
        "id": "Participant",
        "questions": [
            {
                "actionType": "WriteAnswerQuestion",
                "id": "Name",
                "question": "Please, enter your name:",
                "isRequired": true
            }
        ]
    }
}
Clone this wiki locally