The preferred method is to use the file_field, but this is an
alternative
BTW: What error are you getting when you try to set using file_field?
Basic AutoIT sample
ie.text_field(:id,'document_name').click # Open the popup
myAutoIT = WIN32OLE.new("AutoitX3.Control")
myAutoIT.WinWaitActive("File Upload","",15) # Set focus to the
popup
##myAutoIT.ControlSetText("File Upload","",1148,sFileName) # 1148
is the id found by the AutoIt Finder/Didnt work
myAutoIT.Send("{ALT}n") # Move to the file name field in the popup
myAutoIT.Send(sFileName) # Enter the Path and File Name
myAutoIT.ControlClick("File Upload","","&Open")
On May 2, 4:36 pm, chaand <[email protected]> w
On May 12, 3:09 am, sumit kumar <[email protected]> wrote:
> Ok, my problem is to do with handling a windows ***file upload dialog box*.
>
> I'm trying to write some code that will click the *file upload* button,
> navigate to path where the file is stored and after selecting a file click
> "Open" button of the* file upload dialog box*.
> ie.button(:id, "_______").click_no_wait
> ie.send_keys("c:\__________")
> ie.send_keys("{ENTER}")
>
> Unfortunately click_no_wait just flashes the *dialog box and *does not pop
> up the Dialog Box. I've tried click by itself and that opens the *dialog box
> * but the rest of the script does not execute.
>
> In this case i cannot use the file upload method:-
> $ie.file_field(:name, "").set("your file.txt")
> As there is no text field for setting the file name in the textboxes.
>
> Application Functionality:-
> There is "Select File" button and on clicking it, shows "File Upload" Dialog
> box and if user select a file and press enter the file automatically starts
> uploading....
>
> Any Ideas on this?
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]