I am trying to upload a file in a file upload filed in WebdriverIO with AutoIT. I am unable to execute the .exe file which will select the file from File Explorer in Windows. Can anyone tell me what is the mistake in the code?
var exec = require('child_process').execFile;
/**
* Function to execute exe
* @param {string} fileName The name of the executable file to run.
* @param {string[]} params List of string arguments.
* @param {string} path Current working directory of the child process.
*/
function execute(fileName, params, path) {
let promise = new Promise((resolve, reject) => {
exec(imup.exe, params, { cwd: "F:\\imup.exe" }, (err, data) => {
if (err) reject(err);
else resolve(data);
});
});
return promise;
}