How to upload files with selenium on a Linux machine without using the sendKeys method?
Note: There is no input field for using the sendKeys method.
Below is the locator of the input field to upload a file.
-
2Depends on how the site is doing file uploads.Dave Newton– Dave Newton2021-04-29 12:40:02 +00:00Commented Apr 29, 2021 at 12:40
-
1Via API if it's available. You won't need Selenium for it.vitaliis– vitaliis2021-04-29 12:44:50 +00:00Commented Apr 29, 2021 at 12:44
-
I want to automate the file upload section of the site using selenium for testing purposearpita biswas– arpita biswas2021-04-29 12:55:11 +00:00Commented Apr 29, 2021 at 12:55
-
1Your local machine is Windows, right? I am not sure Robot will run on Linux that's why I asked. And I also know that Robot doesn't work on Windows in headless mode. So it's a problem...Prophet– Prophet2021-04-29 14:18:22 +00:00Commented Apr 29, 2021 at 14:18
-
1It is possible to make the invisible input field visible through javascript executor just before sending the keys. Then again make it to "display : none;" as it was before ... here are the steps : 1. change the visibility of input field to visible 2. send keys 3. change the visibility back to false. try the solution given here : stackoverflow.com/questions/12363038/….DesertPride– DesertPride2021-04-30 09:02:36 +00:00Commented Apr 30, 2021 at 9:02
|
Show 10 more comments
