whydoieven
whydoieven

Reputation: 597

Do AutoIt scripts work with Selenium and Chrome Headless

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!

Upvotes: 0

Views: 2344

Answers (1)

Harry King
Harry King

Reputation: 512

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");

Upvotes: 1

Related Questions