NoMethodError: undefinied method 'goto' for # <Watir::IE:0x3294480>

259 views
Skip to first unread message

ab.ost...@gmail.com

unread,
Feb 2, 2009, 11:12:29 AM2/2/09
to Watir General
Hi there!

def setup
@browser = Wayn::BrowserFactory.create
@user = Wayn::User.new(@browser)
@user.login('tomcio', 'haslo')
end

where

class BrowserFactory
def BrowserFactory.create
browser = Watir::Browser.new

begin
browser.speed = :zippy
browser.bring_to_front
rescue NoMethodError
end

browser
end
end
end

I have installed:
Ruby Version 1.8.6
Installer Version 186-27
firewatir 1.6.2
commonwatir 1.6.2

I have following error:
No method error: undefinied method 'goto' for # <Watir::IE:0x3294480>

I run the same script on another machine and it works therefore I dont
know whats cousing this error.
Thanks in advance


aidy lewis

unread,
Feb 2, 2009, 12:30:37 PM2/2/09
to watir-...@googlegroups.com
What is the purpose of the BrowserFactory class? Has not Watir got its
own 'factory' in Common Watir?

Aidy

aidy lewis

unread,
Feb 2, 2009, 1:01:57 PM2/2/09
to watir-...@googlegroups.com
And your class also shows leakage:

http://en.wikipedia.org/wiki/Leaky_abstraction

Pushing a free flowing language (e.g. English) - in my opinion - is
also a bad move.

Have a look at this:

http://code.google.com/p/cucumber-and-watir/

If anyone wants to use Rspec Cucumber, I will gladly guide them
through it on this list.

Aidy

aidy lewis

unread,
Feb 2, 2009, 1:02:54 PM2/2/09
to watir-...@googlegroups.com
I meant to say: Pushing a free flowing language (e.g. English) into objects ...

Bret Pettichord

unread,
Feb 2, 2009, 2:30:05 PM2/2/09
to watir-...@googlegroups.com
Can you send us a stack trace?

anna barbara ostrowska

unread,
Feb 3, 2009, 3:27:40 AM2/3/09
to watir-...@googlegroups.com
Yes, sure

Loaded suite All Tests
Started
EE

Finished in 0h 0m 0s

1) Error:
test_send_public_gift(TC_Send_Private_Gift):
NoMethodError: undefined method `goto' for #<Watir::IE:0x3294480>
C:\Documents and Settings\anna\Desktop\ruby\Gifts/Wayn/user.rb:12:in `login'

C:\Documents and Settings\anna\Desktop\ruby\Gifts\PrivateGift.rb:15:in `setu
p'

2) Error:
test_send_public_gift(TC_Send_Private_Gift):
NoMethodError: undefined method `close' for #<Watir::IE:0x3294480>
C:\Documents and Settings\anna\Desktop\ruby\Gifts\PrivateGift.rb:19:in `tear
down'

1 tests, 0 assertions, 0 failures, 2 errors


2009/2/2 Bret Pettichord <br...@pettichord.com>:

aidy lewis

unread,
Feb 3, 2009, 5:58:11 AM2/3/09
to watir-...@googlegroups.com
#How about this

require 'watir'

class Browser

def initialize
@browser ||= Watir::IE.new
@browser.speed = :zippy
@browser.bring_to_front
@browser.maximize
end

def close
@browser.close
puts "we have closed the browser"
end

#watir methods not in Browser fall into here
def method_missing(method_name,*args)
@browser.send(method_name, *args)
end

end

browser ||= Browser.new
browser.goto('www.fsf.org')
browser.close


#Aidy


On 02/02/2009, ab.ost...@gmail.com <ab.ost...@gmail.com> wrote:
>

anna barbara ostrowska

unread,
Feb 3, 2009, 8:03:35 AM2/3/09
to watir-...@googlegroups.com
There is require 'watir'
---

require 'watir'

class BrowserFactory
def BrowserFactory.create
browser = Watir::Browser.new

begin
browser.speed = :zippy
browser.bring_to_front
rescue NoMethodError
end

browser
end
end
end

2009/2/3 aidy lewis <aidy....@googlemail.com>:

Bret Pettichord

unread,
Feb 3, 2009, 11:02:26 AM2/3/09
to watir-...@googlegroups.com
Not sure. I did notice that you have some other method calls to the
browser where you are trapping the NoMethodError. Why are you doing that?

Also, it might help us if you could create a simple script that
reproduces this problem. I personally don't have issues with the
framework you've developed, but I think it is distracting some people
and keeping them from helping you with your problem.

Can you isolate the problem to a short procedure that doesn't use your
framework (open-coding).

Bret

anna barbara ostrowska

unread,
Feb 6, 2009, 5:59:18 AM2/6/09
to watir-...@googlegroups.com
This has helped:
gem update --system
gem install windows-pr
gem install watir
Thanks.

2009/2/3 Bret Pettichord <br...@pettichord.com>:

Henry

unread,
Feb 25, 2009, 7:00:50 AM2/25/09
to Watir General
I have the following problem:

Script:

require 'rubygems'
require 'watir'

brow = Watir::Browser.new
site = 'http://www.tulugar.com'
brow.goto(site)

Displays the following error:

"undefined method 'goto' <Watir::IE0X2c3b368> for # (NoMethodError)"

The environment variable is watir_browser = ie
Watir 1.6

I appreciate your help

On 6 feb, 08:59, anna barbara ostrowska <ab.ostrow...@gmail.com>
wrote:
> This has helped:
> gem update --system
> gem install windows-pr
> gem install watir
> Thanks.
>
> 2009/2/3 Bret Pettichord <b...@pettichord.com>:
>
>
>
> > Not sure. I did notice that you have some othermethodcalls to the
> > browser where you are trapping the NoMethodError. Why are you doing that?
>
> > Also, it might help us if you could create a simple script that
> > reproduces this problem. I personally don't have issues with the
> > framework you've developed, but I think it is distracting some people
> > and keeping them from helping you with your problem.
>
> > Can you isolate the problem to a short procedure that doesn't use your
> > framework (open-coding).
>
> > Bret
>
> > anna barbara ostrowska wrote:
> >> Yes, sure
>
> >> Loaded suite All Tests
> >> Started
> >> EE
>
> >> Finished in 0h 0m 0s
>
> >>   1) Error:
> >> test_send_public_gift(TC_Send_Private_Gift):
> >> NoMethodError:undefinedmethod`goto' for #<Watir::IE:0x3294480>
> >>     C:\Documents and Settings\anna\Desktop\ruby\Gifts/Wayn/user.rb:12:in `login'
>
> >>     C:\Documents and Settings\anna\Desktop\ruby\Gifts\PrivateGift.rb:15:in `setu
> >> p'
>
> >>   2) Error:
> >> test_send_public_gift(TC_Send_Private_Gift):
> >> NoMethodError:undefinedmethod`close' for #<Watir::IE:0x3294480>
> >>     C:\Documents and Settings\anna\Desktop\ruby\Gifts\PrivateGift.rb:19:in `tear
> >> down'
>
> >> 1 tests, 0 assertions, 0 failures, 2 errors
>
> >> 2009/2/2 Bret Pettichord <b...@pettichord.com>:
>
> >>> Can you send us a stack trace?
>
> >>>> Nomethoderror: undefiniedmethod'goto' for # <Watir::IE:0x3294480>

JArkelen

unread,
Feb 27, 2009, 7:32:27 AM2/27/09
to Watir General
I have the same problem: I have 2 vmware images with the exact same
setup. I try to run this test:

require 'rubygems'
require 'watir'

Watir.options_file = 'c:\\temp\\options.yml'
browser = Watir::Browser.new
browser.goto "http://www.cnn.com"
browser.close

It works on one image, the other image says "undefined method 'goto'
<Watir::IE0X2c3b368> for # (NoMethodError)"
I also tried to install this:

gem update --system
gem install windows-pr
gem install watir

But to no effect unfortunately. Any help would be great!

Cheers,
John

JArkelen

unread,
Feb 27, 2009, 9:46:30 AM2/27/09
to Watir General
I solved the problem by doing a "gem uninstall win32-api" first, and
then to install it again with "gem install win32-api".
What I noticed was that there were 2 versions of win32-api installed.
I removed them both.
Reply all
Reply to author
Forward
0 new messages