I am using Selenium WebDriver for automation. Uploading files in WebDriver is done by simply using the sendKeys() method on the file input field.
Code snippet:
WebElement uploadElement = driver.findElement(By.id("uploadfile"));
// enter the absolute file path into the file input field
uploadElement.sendKeys("C:\\test.txt");
Above code snippet works as expected when script execution is running on Local machine.. But it is not working when script execution is running on Zalenium docker container.