I cannot upload files with selenium web driver.
I have a problem uploading a file via selenium web driver v.3.5.3 in firefox 55.0.3
Geckodriver 0.18.0
Both of the instructions are correct.:
WebElement elem=driver.findElement(By.xpath("//input[@type='file']"));
elem.sendKeys("C:\opt\formatos_excel_importacion\prueba.txt");
In Google chrome it works fine, but it doesn't do the same in firefox.
The error says: Exception in thread "main" org.openqa.selenium.InvalidArgumentException: File not found: C:\opt\formatos_excel_importacion\prueba.txt
Please check this issue. https://github.com/mozilla/geckodriver/issues/858
This configuration set working for me..!!
Geckodriver - 0.17.0
FireFox - 54.0 (64-bit)
Os - Mac
Selenium Version - v.3.5.3
Please provide full stacktrace for exception
org.openqa.selenium.InvalidArgumentException: File not found: C:\opt\formatos_excel_importacion\prueba.txt
Thanks for the advices, I found the solution to my problem. FirefoxProfile profile=new FirefoxProfile(); profile.setPreference("dom.file.createInChild",true); DesiredCapabilities capabilities=DesiredCapabilities.firefox(); capabilities.setCapability(FirefoxDriver.PROFILE,profile); driver=new FirefoxDriver(capabilities); Now I can upload files normally. I know the problem will be solved for the next Firefox version.
Hi @rleaplaza Have you tried this with Chrome browser? I am facing similar problem with chromedrive latest version & browser version version: 70.0.3538.110.