Karate: unable to switch drive and execute .bat file

Viewed 41

I have used karate for API, performance, UI with robot and now trying cli options.

while scripting i came across the below scenario and need few suggestion from experts of karate

I used karate.fork to navigate to different drive on my machine and tried to select a .bat file for particular app execution which didn't work as expected.

below is the sample look alike which i have used

* def command =
"""
function(line) {
  var proc = karate.fork({ redirectErrorStream: false, useShell: true, line: line });
  proc.waitSync();
  karate.set('sysOut', proc.sysOut);
  karate.set('exitCode', proc.exitCode);
}
"""
* command('cd C:/Users/testdata/exe.bat')
* command('Sender -i UXPRUN)
* command('accept NO9434')

I have to open particular .bat file and start it then send the accept command.

if this is wrong approach, could you suggest a way to achieve this

0 Answers
Related