Possible issues with 1.6.1

9 views
Skip to first unread message

Arkie

unread,
Nov 4, 2008, 5:05:51 PM11/4/08
to Watir General
Hi folks.


Env:
- WinXp
- Ruby 1.8.6
- Watir 1.6.1

This was a clean install of Ruby and Watir. All previous version of
Ruby/watir were previously uninstalled.

1)
I had to register the autoitx3.dll by hand.
I remembered that the install of the gem took care of this
automatically?


2)
Firing up irb, taking the following steps returns an error saying that
I'm missing some safari files.

Commenting out the relevant lines for safari support (lines 11 & 12 in
commonwatir\Browsers.rb) moves me along, but this might be useful for
some, or maybe I'm just missing something.


irb(main):001:0> require 'watir'
=> true
irb(main):002:0> include Watir
=> Object
irb(main):003:0> require 'watir/WindowHelper'
MissingSourceFile: no such file to load -- safariwatir
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/core_ext/module/introspection.rb:57:i
n `const_get'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/core_ext/module/introspection.rb:57:i
n `local_constants'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/core_ext/module/introspection.rb:57:i
n `each'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/core_ext/module/introspection.rb:57:i
n `local_constants'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/core_ext/module/introspection.rb:55:i
n `each'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/core_ext/module/introspection.rb:55:i
n `local_constants'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/core_ext/module/introspection.rb:73:i
n `local_constant_names'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/dependencies.rb:334:in `new_constants
_in'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/dependencies.rb:331:in `collect'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/dependencies.rb:331:in `new_constants
_in'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support/dependencies.rb:510:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_support.rb:40
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.1/lib/watir/
non_control_elements.rb:1
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.1/lib/watir/
ie.rb:82
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.1/lib/watir/
WindowHelper.rb:2
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from (irb):3irb(main):004:0> exit

Bret Pettichord

unread,
Nov 5, 2008, 10:01:31 AM11/5/08
to watir-...@googlegroups.com
Arkie wrote:
> Env:
> - WinXp
> - Ruby 1.8.6
> - Watir 1.6.1
>
> This was a clean install of Ruby and Watir. All previous version of
> Ruby/watir were previously uninstalled.
>
> 1)
> I had to register the autoitx3.dll by hand.
> I remembered that the install of the gem took care of this
> automatically?
>
Actually this is registered not on installation, but on first use --
assuming you have admin privileges. Nothing has changed with this since
1.5, but this is an important point nonetheless. Thanks for the report.

> 2)
> Firing up irb, taking the following steps returns an error saying that
> I'm missing some safari files.
>
> Commenting out the relevant lines for safari support (lines 11 & 12 in
> commonwatir\Browsers.rb) moves me along, but this might be useful for
> some, or maybe I'm just missing something.
>
OK. this is really interesting. I'll have to figure out why this is
happening. Not good.

MHwee

unread,
Nov 6, 2008, 2:35:08 PM11/6/08
to Watir General
I got different from 1.6.1.

e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/
core_ext/m
odule/introspection.rb:57:in `const_get': no such file to load --
safariwatir (M
issingSourceFile)
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/core_ext/module/introspection.rb:57:in `local_constants'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/core_ext/module/introspection.rb:57:in `each'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/core_ext/module/introspection.rb:57:in `local_constants'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/core_ext/module/introspection.rb:55:in `each'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/core_ext/module/introspection.rb:55:in `local_constants'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/core_ext/module/introspection.rb:73:in `local_constant_names'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/dependencies.rb:334:in `new_constants_in'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/dependencies.rb:331:in `collect'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/dependencies.rb:331:in `new_constants_in'
from e:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/
active_suppo
rt/dependencies.rb:510:in `require'
from e:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:55
from e:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:213:in `[]'
from e:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:213:in `run'
from e:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
from e:/ruby/lib/ruby/1.8/test/unit.rb:278

Bret Pettichord

unread,
Nov 6, 2008, 3:18:25 PM11/6/08
to watir-...@googlegroups.com
Can you give me more information about the context for this error?

Michael Hwee

unread,
Nov 7, 2008, 12:06:00 PM11/7/08
to watir-...@googlegroups.com

This is strange.
I didn't get this anymore after running a short simple script first.
I guess I have no idea how that happens.

Consider to be solved by itself -- not likely to happen most of the time though :)

Michael

Michael Hwee

unread,
Nov 7, 2008, 1:19:53 PM11/7/08
to watir-...@googlegroups.com

I guess I spoke too soon.

Bret, this is how you reproduce it.

Some old scripts have "include Watir" which is the culprit.

require 'watir'
include Watir

Can you take a look?

Thanks

Bret Pettichord

unread,
Nov 7, 2008, 1:26:32 PM11/7/08
to watir-...@googlegroups.com
I've reproduced the issue. Thanks

Bret Pettichord

unread,
Nov 7, 2008, 1:44:12 PM11/7/08
to watir-...@googlegroups.com
Ok, here are some solutions.

1. Don't put "include Watir" at toplevel. I've argued many times before
that this is a bad idea. I think that almost every one who does this
does so out of confusion. They think that it is like "include" in Perl
or "import" in Java, but it isn't. Specifically, Java's import is a
naming convenience that affects the current file. Ruby's include is a
naming conventience that affects the current file AND EVERY OTHER RUBY
FILE. Sorry for the shouting, but what it actually does it take
everything in the Watir module and add them to the base object that is
used by every other Ruby class, module and library. It is much, much
worse than using global variables.

OK, end of rant. In this case it is running into a conflict with the
activesupport package, which Watir recently started using to help
simplify our code base.

If you really want to still use "include Watir" there are two other
workarounds:

2. Move the "include Watir" statement to the specific class where you
need it (e.g. your test case class). This is actually a perfectly
reasonable use of this command.

3. Add a "require 'watir/ie'" to your script after "require 'watir'"

Bret

Michael Hwee

unread,
Nov 7, 2008, 1:58:13 PM11/7/08
to watir-...@googlegroups.com

I will ask scripters to remove 'include Watir' from their scripts.

Can you add this resolution in release notes or somewhere?

Thanks, Bret.

Bret Pettichord

unread,
Nov 7, 2008, 3:00:19 PM11/7/08
to watir-...@googlegroups.com
I think this should go in the FAQ. Or maybe we should have a wiki page
with issues relating to upgrading to 1.6.

Bret

Reply all
Reply to author
Forward
0 new messages