How to upload file using Selenium WebDriver in Java
First make sure that the input element is visible As stated by Mark Collin in the discussion here: Don’t click on the browse button, it will trigger an OS level dialogue box and effectively stop your test dead. Instead you can use: driver.findElement(By.id(“myUploadElement”)).sendKeys(“<absolutePathToMyFile>”); myUploadElement is the id of that element (button in this case) and … Read more