1.    # Variable initialization based on target OS.
2.    # If the "OS" variable is not initialized, default to Windows.
3.    Var RUN_BOX_KEY="Windows+r"
4.    Var CALCULATOR_CMD="calc"
5.   
6.    # Both systems close applications through Alt+F4
7.    Var CLOSE_KEY="Alt+F4"
8.   
9.    if ("{OS}" == "Linux") {
10.      Var RUN_BOX_KEY="Alt+F2"
11.      Var CALCULATOR_CMD="gnome-calculator"
12.    }
13.   
14.    # Start an application through the Run box.
15.    # Params: {1} ... application start command
16.    procedure startApp {
17.      Press "{RUN_BOX_KEY}" wait=5s
18.      Typeline "{1}" wait=4s
19.    }
20.   
21.    # Start the calculator, calculate an expression, take
22.    # a screenshot to a uniquely named file and close it.
23.    # Params: {1} ... numeric expression to type, for ex. "5+5"
24.    procedure calculate {
25.      startApp "{CALCULATOR_CMD}"
26.      Typeline "{1}" wait=2s
27.      Screenshot calculator_{_CURTIME}.jpg desc="Result of {1}"
28.      Press "{CLOSE_KEY}" wait=2s
29.    }

 

12 December 2014

Copyright © T-Plan Ltd.

Version 1.0