user5199
user5199

Reputation: 369

Edge Upload File control using Selenium

I am trying to upload a file using Selenium Webdriver on the Edge browser, and yes I have downloaded EdgeDriver and installed the MSI for testing Edge. Clicking on elements on the screen from within the Edge browser works fine. The problem is the upload file control. My code is as follows:

IWebElement fileUploader2 = Browser.Driver.FindElements(By.CssSelector("input[type='file']"))[0];
        fileUploader2.SendKeys(FileUtility.FileUploadsDirectory + "\\sample-account_balances.xlsx");

The code above works for Chrome and Firefox, but does not work for Edge. This is a ReactJS web app. I have tried the suggestions below that are similar to my code above and I cannot seem to upload a file using the control programmatically from Selenium Webdriver. There is no error given it just does not click on send text to the file upload control. Nothing is executed:

How to upload file using Selenium Webdriver?

File Control on Edge

DOM Upload Control Edge

Upvotes: 2

Views: 1890

Answers (1)

jhoward
jhoward

Reputation: 414

Unfortunately this feature has not been added to the edge webdriver yet. I've run into the same problem and have not been able to find a suitable solution yet. One (admitedly not ideal) solution is to use AutoIt to automate the file upload for edge. There are multiple reports of this issue, but here's one of the latest reports showing that its an issue with the edge driver.

Upvotes: 2

Related Questions