Hello,
I did something like this through the use of batch files (as they are launched on a remote simulator PC), though I did not launched the .exe directly.
I describe it below, hoping it can help :
For instance, I have a .bat file that launches simulator exe as follows:
start %2\\WaterMeter -KNXAddressIndex 2/0/22 -KNXAddressFlow 2/0/23 -IPserver %1 -DeviceName \"Water1\" -RefresRate 10 -PulseMode 4
ping 1.1.1.1 -n 1 -w 10 > nul
in that line the exe name is WaterMeter.exe, the rest concerns launching parameters. the %1 and %2 data are batch parameters that are set in the command line launched in the groovy step.
The groovy step is the following (the interesting part is at the end) :
// launch the required simulators for non reg execution
// use domo-simu server
def simulator_ip = context.expand( '${#Project#DOMO-SIMU_address}' )
def simulator_path = context.expand( '${#Project#simu_tools_path}' )
def simulator_name = context.expand( '${#TestCase#simulator_name}' )
switch(simulator_name)
{
case "generic":
file = "launch_generic_simu.bat"
break;
case "hot_water":
file = "launch_hot_water_simu.bat"
break;
case "electricity":
file = "launch_electric_meters_simu.bat"
break;
case "gas":
file = "launch_gas_meters_simu.bat"
break;
case "water":
file = "launch_water_meters_simu.bat"
break;
case "ventilation":
file = "launch_ventilation_simu.bat"
break;
case "close":
file = "closeAll.bat"
break;
case "All" :
default :
file = "launch_simulators.bat" // launch all available simulators
break;
}
cmd = simulator_path + "\\$file " + simulator_ip + " " + simulator_path
log.info "cmd = $cmd"
process = Runtime.runtime.exec(cmd)
Thread.sleep(2000)
This process allows me to send my simulator interfaces.
command parameters :
- Simulator_path+file is the path where the batch file is.
- simulator_ip is specific to my case as the server that pilots the simulator interface is on a remote PC
- the last simulator_path data is, if I remember well, the location from where you launch the .exe
You will probably not need to proceed this way. Setting your paht/appli.exe in cmd then launch the process will be sufficient.
I don't deal with return data, though the 'process' variable should help you to get some information.