AutoIt: Regarging AutoIt usage with Firefox

Hi,

I am trying to automate some operations in Firefox using AutoItX3 dll. I
am giving a sample script below, and in this both WinExists and WinClose
return 0 (false), although it should return 1 (true as per AutoIt).

require 'firewatir'
require 'win32ole'

ff = FireWatir::Firefox.new
autoit = WIN32OLE.new("AutoItX3.Control")
sleep 5.0
puts autoit.WinExists("[CLASS:MozillaUIWindowClass]")
sleep 2.0
puts autoit.WinClose("[CLASS:MozillaUIWindowClass]")

Can anyone let me know what is wrong with this script, or is it not
feasible?

Thanks,
Anukul

···

--
Posted via http://www.ruby-forum.com/.

I tried it myself and it returns 1 1. This is because you are printing
first the window exists, and it's true, so if that window exists the
winclose will be true too.
It's returning 0 to you, because it doesn't find the window, try using
the name, not classname.

···

--
Posted via http://www.ruby-forum.com/.

Agustin Ramos wrote:

I tried it myself and it returns 1 1. This is because you are printing
first the window exists, and it's true, so if that window exists the
winclose will be true too.
It's returning 0 to you, because it doesn't find the window, try using
the name, not classname.

Hi Agustin,

Thanks for your reply. Is it possible for you to send me the script you
have written, so that I can try the same from my end?

Thanks,
Anukul

···

--
Posted via http://www.ruby-forum.com/\.

I have the same code that you have, do you have firefox 3.0?? are you
using the last version of win32ole and firewatir??

···

--
Posted via http://www.ruby-forum.com/.

Agustin Ramos wrote:

I have the same code that you have, do you have firefox 3.0?? are you
using the last version of win32ole and firewatir??

Actually, I have been using a very old version of firewatir (1.2.1),
firefox (3.0), not sure about the version of win32ole, can you tell me
what version you are using?

Thanks,
Anukul

···

--
Posted via http://www.ruby-forum.com/\.