0

So, all my current scripts run with Selenium in Chrome Headless mode. Now, we have a small component which basically makes it mandatory for a user to upload a file before the flow gets completed.

The upload is a normal window file select box.

I had two solutions in mind to automate this - Sikuli or AutoIT. I'm very sure that Sikuli does not work in headless. What about AutoIT? Does it support headless mode?`

I am desperate to keep the scripts working headlessly since they are also linked to a Linux Jenkins machine and there is no way I can change that setup.

I did some browsing but there is no concrete answer available to suggest whether or not AutoIt runs in Chrome Headless. Any previous experience or tips is much appreciated!

Andreas
  • 5,393
  • 9
  • 44
  • 53
whydoieven
  • 589
  • 2
  • 7
  • 21

1 Answers1

1

AutoIt can't be used to click on a headless browser. However, if the form is a standard file upload, you should be able to sendKeys() in selenium to send the path of the file to the input.

driver.findElement(By.cssSelector("input[type='file']")).sendKeys("/Users/me/Desktop/file.txt");
Harry King
  • 502
  • 4
  • 15