[Wtr-general] Watir + Autoit + Save As

Charley Baker charley.baker at gmail.com
Fri May 4 11:24:48 EDT 2007


It looks fine, you might however have to use ControlFocus to make sure the
control has focus before attempting to click on it.

autoit.ControlFocus("Enregistrer sous", "", "&Enregistrer")
autoit.ControlClick("Enregistrer sous", "Enregistrer &dans :",
"&Enregistrer")

-Charley

On 5/4/07, Maisonnette <forum-watir-users at openqa.org> wrote:
>
> Hi everyone,
>
> Do you know how can i use watir to 'pilot' a 'save as' internet explorer
> form ?
> I already found this code :
> -----
>
>     *autoit = WIN32OLE.new("AutoItX3.Control")*
>     *autoit.WinWait("Téléchargement de fichier", "Voulez-vous ouvrir ou
> enregistrer ce fichier ?", 15)*
>     *autoit.ControlClick("Téléchargement de fichier", "", "Button2")*
>     *autoit.WinWait("Enregistrer sous", "Enregistrer sous", 15)*
>     *autoit.ControlSetText("Enregistrer sous", "Enregistrer &dans :",
> "Edit1", "c:\test.zip")*
>     *autoit.ControlClick("Enregistrer sous", "Enregistrer &dans :",
> "&Enregistrer")*
>
> -----
>
> The line number 1 : Return 1
> The line number 1 : Return 1
> The line number 1 : Return 1
> The last one return 0
>
> And with this code i got the focus on the 'save as'(Enregistrer sous)
> button ... I really don't understand why i can't click on it because the
> 'ControlClick' function is build to do that !
>
> :-) Any help will be highly appreciated ! :-)
>
> Some complementary informations :
> -----
>
> +http://rubyforge.org/tracker/index.php?func=detail&aid=2467&group_id=104&atid=490+
> +http://www.autoitscript.com/autoit3/docs/functions.htm+
> +WinXp Sp2 (French)+
> +ruby 1.8.5 (2006-08-25) [i386-mswin32]+
> +watir-1[1].5.1.1145 (gem)+
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070504/26d29763/attachment-0001.html 


More information about the Wtr-general mailing list