Is there a way to interact with a File Upload box in webdriver? The form field where the path gets put in is read only so I can\'t write to that.
For C#, SendKeys()
works but you have to use \
in your file path instead of /
For example, the follow works :
string filePath = @"drive:\path\filename.filextension";
driver.FindElement(By.Id("fileInput")).SendKeys(filePath);
But the following doesn't work :
string filePath = "drive:/path/filename.filextension";
driver.FindElement(By.Id("fileInput")).SendKeys(filePath);