I have tried Karate framework feature karate.fork to execute SCP command but it throws command error:
[scp.exe, -r, -i, C:\Users\pcmoh.ssh\id_rsa, user@server:/data/volume1/, C:\Users\pcmoh\karatetestjavascript\test\features\api\output] - Cannot run program "scp.exe": CreateProcess error=2, The system cannot find the file specified.
But SCP command is working fine in command prompt and in powershell window separately.
I could not resolve this issue.
Operating System: Windows 10
Code snippet - ISSUE-1
* def command =
"""
function(line) {
var proc = karate.fork({redirectErrorStream: false, useShell: true, line: line });
proc.waitSync();
karate.set('sysOut', proc.sysOut);
karate.set('sysErr', proc.sysErr);
karate.set('exitCode', proc.exitCode);
}
"""
* command('scp -r -i C:\\Users\\pcmoh\\.ssh\\id_rsa user@<server>:/data/volume1/ C:\\Users\\pcmoh\\karatetestjavascript\\test\\features\\api\\output')
* match sysOut contains 'volume1'
* assert exitCode == 0