0

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.

enter image description here

15
  • 2
    Depends on how the site is doing file uploads. Commented Apr 29, 2021 at 12:40
  • 1
    Via API if it's available. You won't need Selenium for it. Commented Apr 29, 2021 at 12:44
  • I want to automate the file upload section of the site using selenium for testing purpose Commented Apr 29, 2021 at 12:55
  • 1
    Your 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... Commented Apr 29, 2021 at 14:18
  • 1
    It 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/…. Commented Apr 30, 2021 at 9:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.