Selenium "sendkeys" for upload file is not working under chrome but working under firefox

1.2k views Asked by At

I have no idea why the the same method is not working under chrome:

profileFilePath1 = "C:\\test\\1.zip";

driver.findElement(By.xpath("//input[@name='upload']")).sendKeys(profileFilePath1);
driver.findElement(By.xpath("//input[@value='Upload']")).submit();

No error in the console. It is told that the file is invalid, this is checkup by the browser.

But it is working perfect in firefox.

0

There are 0 answers