harrydev Posted December 18, 2013 Share Posted December 18, 2013 How can i pass the specific file to AutoIt from selenium and upload that particular file: Say for example now i have created a file with name "test.doc" in a specific location using selenium with java. And now i want to upload a document which i have created recently. I need to pass file path to AutoIT script from Selenium and upload that file using AutoIT How can i achieve this with AutoIT . can we extend the below WebElement file_input = driver.findElement(By.id("id_of_button")); file_input.sendKeys("C:SeleniumImageUpload_FF.exe"); Link to comment Share on other sites More sharing options...
orbs Posted December 18, 2013 Share Posted December 18, 2013 not knowing anything about Selenium, but the logic is that if Selenium is calling your AutoIt script, then the script can accept command line arguments and work with them. once you get that, how to upload it would require to use the IE UDF or FTP commands, depending on your case. where exactly are you stuck? Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
harrydev Posted December 18, 2013 Author Share Posted December 18, 2013 My problem here is: I cannot pass the exact document name / path in the AutoIt script before the document is created (document name will be keep changing). Now i created a new document and stored in specific folder. My exact requirement is to pick that specific document / file which is created to AutoIt and Upload it using the AutoIt Link to comment Share on other sites More sharing options...
orbs Posted December 18, 2013 Share Posted December 18, 2013 if you let AutoIt script detect the latest file in a known folder, would that do? this is quite easy. first result in Google will get you going: '?do=embed' frameborder='0' data-embedContent>> Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff 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