AutoIt: Regarging AutoIt usage with Firefox

A

Anukul Singhal

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
 
A

Agustin Ramos

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.
 
A

Anukul Singhal

Agustin said:
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
 
A

Agustin Ramos

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

Anukul Singhal

Agustin said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top