1

I have a Protractor/Cucumber script, that successfully uploads a file on Chrome/Firefox. When I run the same script on IE11, then the website hangs with the file dialog box open and no file sent.

The only error message I get is

"UnsupportedOpperationError: Error 404: Not Found."

My HTML for the upload is basic

<input name="myFile" type="file">

I have also sent the absolute path:

C:\fullpath

I am using selenium standalone server 3.5.0 and IEDriver 3.4.0 (32-bit)

From my research, there has been an issue with IE and the security or advanced settings. Unfortunately, as this is a business project I'm unable to configure the settings for IE. The workaround being adding the ignoreProtectedModeSettings: true to the capabilities. For my capabilities, I have used

capabilites : { 
    browserName: 'internet explorer',
    platform: 'windows',
    version: '11',
    maxInstances: 1,
    ignoreProtectedModeSettings: true,
    'ie.fileUploadDialogTimeout': 10000 //I read this might have been an issue but didn't change anything
    nativeEvents: true,
    unexpectedAlertBehavior: 'accept',
    enablePersistentHover: true,
    ignoreZoomSettings: true,
    requireWindowsFocus: true,
    'disable-popup-blocking': true,
    javascriptEnabled: true,
    restartBrowserBetweenTests: true,
    INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS: true
}

My code for uploading the file is also basic element(by.css('input[type="file"])).sendKeys(absolutePath)

Any ideas or examples would be helpful!

14
  • If you can explicitly add wait before upload for 2-3 sec? Hv you tried? I had implemented same functionality for Chrome and IE11. Which is working. If this doesn't work then will check system config n other versions Jun 3, 2021 at 5:36
  • Hi Narendra, I have tried to add a wait and the result is the same hanging on the file explorer popup. Jun 4, 2021 at 14:05
  • Have you verified, Page loaded completely before sendKeys() & Manually its working on IE? Jun 7, 2021 at 6:08
  • @DevinPatrickAshcraft why are you opening file explorer when using send keys ? don't click browser button just use sendkeys and then clic
    – PDHide
    Jun 8, 2021 at 16:56
  • @PDHide , I am not clicking the browse button, I am only using sendkeys. Sendkeys opens the file explorer, the same thing on firefox and chrome the file explorer opens but closes automatically. Jun 8, 2021 at 17:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.