I know the default answer to handling explorer.exe is to use AutoIT, but AutoIT utilizes Java Runtime to use the exported .exe to upload the file and close the dialog. My tests are all in Protractor since this is an AngularJS app.
The selectFile
function is:
selectFile: function(image) {
var path = require('path');
var image_path = path.resolve(__dirname, image);
this.uploadButton.click();
this.uploadButton.sendKeys(image_path);
}
I've run my full suite of tests in Chrome, Firefox, and IE11. Chrome and Firefox just leave the file upload window open and carry on their tests in the background. IE absolutely will not continue after clicking the upload button. The dialog box must be dealt with somehow, but my test can't even get to this.uploadButton.sendKeys(image_path);
with that window open.
Is there a way to kill that File Upload box via Javascript, whether it be by process id or something else?
More detailed info on my attempts at getting around this are on my Stack Overflow question from before I knew this site existed. Since you all are more specialized, perhaps I can get more / different answers here, too.