I'm trying to upload a file using Selenium by sending keys (the file path). It works, but it also opens the file picker dialog and it never gets closed. It doesn't occurs any problem though, but in headless it makes the tests to fail with the error: Failed to decode response from marionette or Tried to run command without establishing a connection.
How can I prevent the file picker dialog from opening? I tried this solution, but it doesn't seem to work.