I running selenium testcases with a remote driver on a docker container.
I want to upload files to a chrome browser running on a conatiner.
I have tried the following:-
- Copied file from my local system(MyDocuments folder) to the docker container. When I click on the upload button, I am not sure how to navigate through the folders and upload the file.
I tried this but at "input.sendKeys(imagePath);" line I get the message "element not interactable":- https://stackoverflow.com/a/54810763
- I am running testcases on a container but the screenshots are saved on my local machine. Is it possible that I can also upload the files from my local machine and not from container
String FileName = "Test.jpeg";
driver.setFileDetector(new LocalFileDetector());
WebElement element = driver.findElement(By.xpath("//input[text()='Upload File']"));
File file = new File("I want to upload image present in this location");
element.sendKeys(file.getAbsolutePath());