[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Watir is acting retarded

Daniel Waite

2/5/2009 6:33:00 AM

This...

NameError: uninitialized constant Windows::API::Error

Or this...

irb(main):009:0> Watir::IE.new.goto 'google.com'
NoMethodError: undefined method `goto' for #<Watir::IE:0x32e108c>

I reinstalled Windows about 4 hours ago. I installed the network card
drivers and Ruby via the one-click installer.

I then installed the Watir gem. The above error messages are all I'm
getting when attempting to use it.

I am running as the administrator on this machine. I have registered the
AutoIt file manually.

Any ideas? Google turns up _nothing_ related specifically to these
issues. Surely I cannot be the only person who has encountered this.
--
Posted via http://www.ruby-....

12 Answers

Brian Tomlin

2/5/2009 5:04:00 PM

0

I am having this exact same problem, and it just started yesterday. I
don't know if this is some kind of crazy coincidence or what the heck is
going on. It's really weird because I ran Watir scripts earlier in the
day yesterday, and now they just don't work. Unfortunately I have no
idea what the cause might be, but I have a thread about this started in
the Watir group over in google groups. I will post back here if they
have any insight into this.



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

Brian Tomlin

2/5/2009 5:27:00 PM

0

Charley Baker (Watir lead developer) had the solution to this in the
Watir group. It appears that the win32utils libraries had a
compatibility issue. The solution is just to update the libraries with
this:

gem install windows-pr

If you are not a member of the Watir group, I highly recommend joining:

http://groups.google.com/group/watir-gen...

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

Daniel Waite

2/5/2009 6:20:00 PM

0

Brian Tomlin wrote:
> gem install windows-pr

That helped. But now I am seeing this...

C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/m
odule/introspection.rb:70:in `const_get': no such file to load --
safariwatir (M
issingSourceFile)

On a whim I tried gem install safariwatir and get...

Building native extensions. This could take a while...
ERROR: Error installing safariwatir:
ERROR: Failed to build gem native extension.

C:/Ruby/bin/ruby.exe extconf.rb install safariwatir
create C:/Ruby/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/src/osx_ruby.h
...
create
C:/Ruby/lib/ruby/gems/1.8/gems/rb-appscript-0.5.1/src/osx_intern.h ...
creating Makefile

nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.

... Really? I'm on Windows. I don't have make.

Ugh... This gem USED to work just fine.
--
Posted via http://www.ruby-....

Brian Tomlin

2/5/2009 6:35:00 PM

0

Daniel, I think you and I are leading parallel lives. I saw the same
thing in a script I had that was something like this:

require 'rubygems'
require 'watir'

ie = IE.new


It used to work, but for some reason to get it to work now I had to
change the last line to:

ie = Watir::IE.new


I hope this works for you.
--
Posted via http://www.ruby-....

Daniel Waite

2/5/2009 10:51:00 PM

0

Brian Tomlin wrote:
> Daniel, I think you and I are leading parallel lives. I saw the same
> thing in a script I had that was something like this:
>
> require 'rubygems'
> require 'watir'
>
> ie = IE.new
>
>
> It used to work, but for some reason to get it to work now I had to
> change the last line to:
>
> ie = Watir::IE.new
>
>
> I hope this works for you.

I've always used Watir::IE.start(string).

Currently, this is working, but calling...

browser = Watir::IE.start(uri)
browser.text_field(:id, text_field_id)

Is raising:

uninitialized constant
Watir::InputElementLocator::MissingWayOfFindingObject Exception

Did they change the API and not tell anyone? As far as I can tell via
the cheatsheet (http://secretgeek.net/watir_chea...) they
haven't. What gives?
--
Posted via http://www.ruby-....

Brian Tomlin

2/5/2009 11:12:00 PM

0

That should work as far as I know. You might want to post this question
on the Watir group along with the html of the element you are trying to
access.
--
Posted via http://www.ruby-....

Tom Cloyd

2/5/2009 11:48:00 PM

0

May I humbly suggest that we use another adverb?

It is difficult enough being born with a cognitive development handicap
about which neither you nor anyone else can do much. It made much harder
when society in general uses words describing you in ways suggesting
that you're undesirable, unwanted, unlike, etc.

In the programming/computer world, we have a similar term, but one which
has much less of a negative loading - AND we're much more able to cope
with any negativity associated with it than are people with cognitive
development challenges. That word is nerd. No one ever feels good about
being called a nerd. No one ever intends good by using the word (except
in humorous settings).

So, lest this get too serious (though it IS a serious issue), dare I say
that to refer to Watir as "retarded" is a really nerdy thing to do? :)
No, I daren't. But...that just might slip out if I allow myself to
bumble alone in my native nerdy mindlessness. Oh my...what did I just
do? It's so easy, isn't it?

No one needs to feel bad, or chastised. I myself once used the "r" word,
in front of 150 people. I also never forget having done it. It was utter
mindlessness, and I intended no harm (I also apologized in my next
sentence), but...it would have been hurtful anyway to anyone affected
who heard it. AND it could have provided a bad example, and that's what
I'm concerned about here. Use of such unfortunately pejorative terms
(and they shouldn't be) really is not tolerable. We all need to be
careful, I think.

t.

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Daniel Waite

2/6/2009 12:40:00 AM

0

Brian Tomlin wrote:
> That should work as far as I know. You might want to post this question
> on the Watir group along with the html of the element you are trying to
> access.

Ah... I'm the retard I guess. Brian, your suggestion did work (thank
you). In my haste I typed...

browser.text_field(:iid, id_string)

Catch it? Hehe... That's what I get for being impatient. Oh well,
problem solved. Yay for Watir! That said, someone please update the
Watir project page! The rdoc documentation is covering 1.5 or something.

@Tom:

> That word is nerd. No one ever feels good about
> being called a nerd. No one ever intends good by
> using the word (except in humorous settings).

Your writing is collectivist in nature, which I reject wholesale. But
this is a forum about Ruby, not philosophy/economics. If you want to
talk about such things meet me at http://mises.org/Communi... and
I will gladly address your points. My username is angryrabbit. See you
there... :)
--
Posted via http://www.ruby-....

Daniel Berger

2/6/2009 1:04:00 AM

0

Daniel Waite wrote:
> This...
>
> NameError: uninitialized constant Windows::API::Error
>
> Or this...
>
> irb(main):009:0> Watir::IE.new.goto 'google.com'
> NoMethodError: undefined method `goto' for #<Watir::IE:0x32e108c>
>
> I reinstalled Windows about 4 hours ago. I installed the network card
> drivers and Ruby via the one-click installer.
>
> I then installed the Watir gem. The above error messages are all I'm
> getting when attempting to use it.
>
> I am running as the administrator on this machine. I have registered the
> AutoIt file manually.
>
> Any ideas? Google turns up _nothing_ related specifically to these
> issues. Surely I cannot be the only person who has encountered this.

Yep, you want this combination:

win32-api 1.3.0 or later
windows-api 0.3.0 or later
windows-pr 0.9.9 or later

Regards,

Dan

Daniel Waite

2/6/2009 1:20:00 AM

0

Daniel Berger wrote:
> Yep, you want this combination:
>
> win32-api 1.3.0 or later
> windows-api 0.3.0 or later
> windows-pr 0.9.9 or later

Duly noted. Installing Watir installed all those things (plus a few
other gems). However, I have two versions of windows-pr: 0.9.3 and
0.9.9. My guess is that Watir installed 0.9.3. Thanks for the summary.
:)
--
Posted via http://www.ruby-....