Skip to content

Close Program Step

Martin Konopka edited this page Oct 20, 2019 · 1 revision

Use this step to explicitly close a program that is running during the session. This step is required to close a program that was kept running (keepRunning setting set to true) or started in the background (runInBackground setting set to true) in Launch Program Step. To associate which program to close, use tag with same value in Launch Program Step and this step.

Definition

  • actionType : "CloseProgram" (required)
  • 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, same value as in the associated Launch Program Step.

Result

  • resultType : "Successful"

Example

The application with tag monitor was launched in the timeline and must be closed:

{
    "action": {
        "actionType": "CloseProgram",
        "tag": "monitor"
    }
},

Open Chrome web browser in Kiosk mode (fullscreen), navigate to the https://www.uxi.sk/ webpage and keep it running during multiple steps. After completing required steps in the timeline, the browser is closed with this step. In more advanced scenarios, the app (or webpage) may listen to or interact with UXC using its API, for example check status of the current session recording or control the session timeline.

{
    "action": {
        "actionType": "Instructions",
        "instructions": "Familiriaze yourself with the next webpage in 20 seconds.",
        "showContinue": true
    }
},
{
    "action": {
        "actionType": "LaunchProgram",
        "path": "c:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
        "arguments": "https://www.uxi.sk/ --kiosk",
        "keepRunning": true,
        "tag": "browser"
    }
},
{
    "action": {
        "actionType": "ShowDesktop",
        "minimizeAll": false
    },
    "completion": {
        "timeout": "00:00:20",
        "hotkeys": [ "F10" ]
    }
},
{
    "action": {
        "actionType": "Instructions",
        "instructions": [
            "Try to find how many workstations with eye tracker are in the laboratory on this page.",
            "",
            "You will have 1 minute to find the information.",
            "If you find it faster, press F10 to continue."
        ]
        "showContinue": true
    }
},
{
    "action": {
        "actionType": "ShowDesktop",
        "minimizeAll": false
    },
    "completion": {
        "timeout": "00:01:00",
        "hotkeys": [ "F10" ]
    }
},
{
    "action": { 
        "actionType": "Questionary",
        "id": "Question",
        "questions": [
            {
                "actionType": "WriteAnswerQuestion",
                "id": "WorkstationsCount",
                "question": "How many workstations with an eye tracker are in the laboratory?",
                "isRequired": true,
                "validAnswerRegexPattern": "[0-9]+"
            }
        ]
    }
},
{
    "action": {
        "actionType": "Instructions",
        "instructions": [
            // further instructions for next task on the same website
        ]
        "showContinue": true
    }
},
{
    "action": {
        "actionType": "ShowDesktop",
        "minimizeAll": false
    },
    "completion": {
        "timeout": "00:01:00",
        "hotkeys": [ "F10" ]
    }
},
{
    // another questionary here, then close the browser
},
{
    "action": {
        "actionType": "CloseProgram",
        "tag": "browser"
    }
}
Clone this wiki locally