Akos Posted April 11, 2018 Share Posted April 11, 2018 I have a Selenium WebDriver based script to automate file uploading. It uploads list of files one by one. I use AutoIT script to handle dialog window, file chooser window. Parameter $CmdLine[1]contains the path of actual file. ControlFocus("Open a file","","Edit1") ControlSetText("Open a file","","Edit1", $CmdLine[1]) ControlClick("Open a file","","Button1") I execute it from Java code as following: Runtime.getRuntime().exec(autoITExecutable); It opens dialog window, so it can't work without focus on browser window. Link to comment Share on other sites More sharing options...
Danp2 Posted April 11, 2018 Share Posted April 11, 2018 Did you have a specific question? Also, where is the parameter being passed to the Autoit executable? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Akos Posted April 11, 2018 Author Share Posted April 11, 2018 Variable autoITExecutable contains path of exe file and parameter value too. My question is, how could I execute test without opening dialog window. I would like to execute it without focus on browser and maybe in headless mode. Link to comment Share on other sites More sharing options...
Danp2 Posted April 11, 2018 Share Posted April 11, 2018 If the goal is to upload files without using the file selection dialog, then I think the solution wouldn't require Autoit and would be dependent on the website involved. Not sure how you would accomplish this without more details. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Akos Posted April 12, 2018 Author Share Posted April 12, 2018 What kind of details? I tried to use sendKeys(""); method, but input field doesn't accept file in this way. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now