I have following code
IWebElement chooseFile = driver.FindElement(By.XPath("//button[@id='btnSelect']"));
chooseFile.SendKeys(@"D:\Workspace\Base Version (Do Not Use)\file.tar.gz");
Its opening up File Explorer but not uploading the file. I tried using JavaScript Executer as below
String filePath = "D:\\Workspace\\Base Version (Do Not Use)\\5GGW3-OMNI-1_R220200BhaT0301E0266.tar.gz";
IJavaScriptExecutor jse = (IJavaScriptExecutor)driver;
jse.ExecuteScript("document.getElementById('btnSelect').value='" + filePath + "';");
didn't work either. Does anyone know of any solution? I'm using FirefoxDriver in C# .NET