Forum: Ruby AutoIt: Regarging AutoIt usage with Firefox

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Anukul S. (Guest)
on 2008-11-27 09:31
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
Agustin R. (Guest)
on 2009-06-17 23:38
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.
Anukul S. (Guest)
on 2009-06-17 23:56
Agustin R. 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
Agustin R. (Guest)
on 2009-06-18 00:03
I have the same code that you have, do you have firefox 3.0?? are you
using the last version of win32ole and firewatir??
Anukul S. (Guest)
on 2009-06-18 00:08
Agustin R. 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
This topic is locked and can not be replied to.