I wrote a Selenium script to download an Excel sheet, open, edit and upload it back. I use AutoIt for the file upload.
I have different files to upload for each run, so I can't hard code the file path, hence I want to pass it (to the AutoIt script) as an argument. The AutoIt script:
ControlFocus("File Upload", "", "Edit1")
Sleep(1000)
ControlSetText("File Upload", "", "Edit1", "C:\Users\nilasing\Downloads\somefilename")
Sleep(1000)
ControlClick("File Upload", "", "Button1")
"C:\Users\nilasing\Downloads\somefilename" is the hard coded path.