title: Is there any way to upload file using selenium in headless chrome?
body: <p>I'm creating a script which requires me to upload a file, so I write something like:</p>
  
  <pre><code>    @FindBy(css = "div[title='Add an attachment'] button")
      private WebElementFacade FILE_UPLOAD_BUTTON;
  
      Path path = Paths.get(System.getProperty("user.dir"));
  
      withTimeoutOf(20, TimeUnit.SECONDS).waitFor(ExpectedConditions.visibilityOf(FILE_UPLOAD_BUTTON));
      FILE_UPLOAD_BUTTON.click();
  
      filePath = Paths.get(path.toString(), "FolderName", "ActualFileName.pdf");
  
      StringSelection fullPath = new StringSelection(filePath.toString());
      Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
      clipboard.setContents(fullPath, fullPath);
  
      Robot robot = new Robot();
      robot.keyPress(KeyEvent.VK_CONTROL);
      robot.keyPress(KeyEvent.VK_V);
      robot.keyRelease(KeyEvent.VK_V);
      robot.keyRelease(KeyEvent.VK_CONTROL);
      robot.keyPress(KeyEvent.VK_ENTER);
      robot.keyRelease(KeyEvent.VK_ENTER);
      pause(2000);
  </code></pre>
  
  <p>And it works fine, but NOT when in Headless chrome. Any ideas on how can I do file upload in Headless chrome? TIA.</p>
  
  <p>Edit: Added <a href="https://github.com/serenity-bdd/serenity-core/issues/1519" rel="nofollow noreferrer">inquiry to serenity</a> and wakaleo doubted that Robot class will work on headless chrome since it interacts with the real UI. I also tried his suggestion to use Standard Selenium Actions like <code>chord org.openqa.selenium.Keys;</code> and <code>actions org.openqa.selenium.interactions.Actions;</code> and both still didn't work</p>