about the watir utilize "autoit"

113 views
Skip to first unread message

vance

unread,
Aug 29, 2008, 2:39:22 AM8/29/08
to Watir General
I run into a problem when using "ie.maximize", and here is the error
details:

C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir.rb:
129:in `initialize': unknown OLE server:
`AutoItX3.Control' (WIN32OLERuntimeError).
from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./
watir.rb:129:in `autoit'
from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/
ie.rb:425:in `autoit'
from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/
ie.rb:422:in `set_window_state'
from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/
ie.rb:398:in `maximize'

I check the "ie.rb" file:

def autoit
Watir::autoit
end


And I only got the "autoit.dll" file in the watir file...So do I need
to install the "autoIt" first?

Vance

Sameh Abdelhamid

unread,
Aug 29, 2008, 2:45:03 AM8/29/08
to watir-...@googlegroups.com
You need to install autoit First...
then you can use the autoit function library by doing the following

require 'watir'
require 'rubygems'
require 'win32ole'
autoit = WIN32OLE.new('AutoItX3.Control')
autoit.ControlClick("[Class:#32770]","","Button1")

In this example I used the controlclick function which is an autoit
function. Once you assign win32ole.new to autoit control, when you
call autoit, it utlises the function library in autoit. You can refer
to the autoit help in order to get the functions and what they do.

for more info check out this link in relation to javascript popups
with autoit.

http://justaddwatir.com/watir/?s=autoit

Sameh

vance

unread,
Aug 29, 2008, 4:54:05 AM8/29/08
to Watir General

Thank you!!

But I think it is not a good idea for using "autoIt". I'm wonder why
"autoIt" is so popular......Still belive we have another ways to
handle this....



Vance

wesley chen

unread,
Aug 29, 2008, 5:05:54 AM8/29/08
to watir-...@googlegroups.com
I can maximize my window when I use:
require 'watir'
ie=Watir::IE.start("www.google.com")
ie.maximize

Possibly, you have not installed the latest Watir completely.
I think you don't need to install or require win32old or something other.

Tony

unread,
Aug 29, 2008, 5:55:22 AM8/29/08
to Watir General
Hi,
The autoit dll file is usually found in the watir folder and is
automatically registered.
The location where this dll file can be found is .. C:\ruby\lib\ruby
\gems\1.8\gems\watir-1.5.6\watir\ - FileName: AutoItX3.dll

If for some reason one gets the error -
`AutoItX3.Control' (WIN32OLERuntimeError), you can register this dll
using regsvr32 to solve the issue.
Go to the folder - C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.6\watir\
and execute this from command prompt - regsvr32 AutoItX3.dll

-Tony

aidy lewis

unread,
Aug 29, 2008, 6:16:44 AM8/29/08
to watir-...@googlegroups.com
HI,

On 29/08/2008, Tony <yno...@gmail.com> wrote:

> If for some reason one gets the error -
> `AutoItX3.Control' (WIN32OLERuntimeError), you can register this dll
> using regsvr32 to solve the issue.
> Go to the folder - C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.6\watir\
> and execute this from command prompt - regsvr32 AutoItX3.dll
>

I think this dll should be auto-registered during gem install. This
may be a bug. Can someone raise it in Jira?

Aidy

Hrishikesh Bose

unread,
Aug 29, 2008, 6:41:21 AM8/29/08
to watir-...@googlegroups.com
Hi all,

I just wanted to evaluate on basic terms as to whether watir can be used
extensively for testing a website (CMS) developed in Apache Wicket.

Thanks,
Hrishikesh Bose

"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment."
www.cybage.com


aidy lewis

unread,
Aug 29, 2008, 6:47:49 AM8/29/08
to watir-...@googlegroups.com
Hi,

On 29/08/2008, Hrishikesh Bose <hrish...@cybage.com> wrote:
>
> Hi all,
>
> I just wanted to evaluate on basic terms as to whether watir can be used
> extensively for testing a website (CMS) developed in Apache Wicket.
>
> Thanks,
> Hrishikesh Bose

Both Watir and FireWatir exercise the browsers' DOM. This means any
technology can be tested if the end stack is a browser display.

Aidy

vance

unread,
Aug 29, 2008, 9:13:06 AM8/29/08
to Watir General
All,

So....may be using "autoIt" is still a good idea for dealing with the
browser object....

yes, any technology can be tested for the web application...

I'm trying to do it in ruby....

Vance


On 8月29日, 下午6时47分, "aidy lewis" <aidy.le...@googlemail.com> wrote:
> Hi,
>

Bret Pettichord

unread,
Aug 29, 2008, 9:52:45 AM8/29/08
to watir-...@googlegroups.com
Aidy,

I agree that this would be nice. However, gems do not allow you to run
scripts during install. So your suggested solution is not possible.

Instead, we register autoit on first usage. I think problems occur when
first usage is made by non-admin, in which case the registration will fail.

One option would be to add a command that would do this registration and
then tell every user to run this command after installing the Watir gem.
Any one interested in writing such a command?

Bret

aidy lewis

unread,
Aug 29, 2008, 10:12:05 AM8/29/08
to watir-...@googlegroups.com
Bret,

On 29/08/2008, Bret Pettichord <br...@pettichord.com> wrote:
>
> Aidy,


>
> One option would be to add a command that would do this registration and
> then tell every user to run this command after installing the Watir gem.
> Any one interested in writing such a command?

Do you mean a batch file?

Aidy

Bret Pettichord

unread,
Aug 29, 2008, 11:50:29 AM8/29/08
to watir-...@googlegroups.com
No i was thinking of a ruby command script, along the lines of "rake" or
"irb" or "watir-console"

Bret

Paul Rogers

unread,
Aug 29, 2008, 12:02:39 PM8/29/08
to watir-...@googlegroups.com
Bret, do you know how some gems ( at least on non win OS ) compile
extensions? Maybe there is something in that process that could be
utilized.

Paul

Reply all
Reply to author
Forward
0 new messages