[Wtr-general] Watir + Autoit + Save As

Grzesiek forum-watir-users at openqa.org
Wed May 23 03:46:43 EDT 2007


Hi,

I had to use the AutoIT tool for identifing the INSTANCE of buttons. Then it worked for me:

autoit = WIN32OLE.new('AutoItX3.Control')
autoit.WinWaitActive("File")   #File Download popup
autoit.ControlClick("File","","[CLASS:Button;TEXT:&Save;INSTANCE:2]")   #clicking Save button

autoit.WinWaitActive("Save As")   #catching the Save As popup
autoit.Send("file_name") #sending file name into window
autoit.ControlClick("Save As", "", "[CLASS:Button;TEXT:&Save;INSTANCE:2]")  #clicking Save button

autoit.WinWaitActive("Download") #catching Download popup
autoit.ControlClick("Download", "", "[CLASS:Button;TEXT:&Open;INSTANCE:2]") #opening the downloaded file

Hope this will help

Br,
Sfistak


More information about the Wtr-general mailing list