[
http://jira.openqa.org/browse/WTR-464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jarmo Pertman closed WTR-464.
-----------------------------
Resolution: Won't Fix
Fix Version/s: Never
This is what i did:
1) gem install watir # installing 1.6.7 of watir, firewatir and commonwatir
2) gem uninstall watir # uninstalling only watir gem 1.6.7 leaving commonwatir
and firewatir intact
3) gem install watir --version 1.6.6 # installing 1.6.6 of watir, firewatir and
commonwatir
Now, in irb:
{code}
require "watir" # loads commonwatir 1.6.7 as expected
$LOAD_PATH.grep /watir/
=> ["C:/ruby_186p398/lib/ruby/gems/1.8/gems/commonwatir-1.6.7/bin", "C:/ruby_186
p398/lib/ruby/gems/1.8/gems/commonwatir-1.6.7/lib", "C:/ruby_186p398/lib/ruby/ge
ms/1.8/gems/firewatir-1.6.7/bin", "C:/ruby_186p398/lib/ruby/gems/1.8/gems/firewa
tir-1.6.7/lib"]
{code}
When doing Watir::Browser.new then a new Firefox window is opened instead of
IE. This is happening because in commonwatir/browsers.rb a
Watir::Browser.support is executed for ie, firefox and safari which in turn
executes Watir::Browser.activate_gem. The method is defined like this:
{code}
# Activate the gem (if installed). The default browser will be set
# to the first gem that activates.
def activate_gem gem_name, option
begin
gem gem_name
@@default ||= option
rescue Gem::LoadError
end
end
{code}
This means that if the gem_name is "watir" then gem "watir" gets Gem::LoadError
with an error message:
{code}
Gem::LoadError Exception: can't activate commonwatir (= 1.6.6, runtime) for
["watir-1.6.6"], already activated commonwatir-1.6.7 for []
{code}
That happens since watir-1.6.6 is depending of the commonwatir 1.6.6, which has
1.6.7 of itself already loaded. Since that error is rescue'd in that method
then nothing is visible to the user and activate_gem is executed with
"firewatir" and this time activation of the gem succeeds.
It would be great if that error message would be shown to the user, but
unfortunately there's no good way to identify that particular gem loading error
and we don't want to print out every gem loading errors also since that would
mean that everyone using only firewatir would see always an error when watir's
gem is trying to be loaded.
The error message you saw about watir/ie not existing is also because watir gem
just doesn't get loaded. It seems that the best option to handle these
situations would be to just document the uninstallation procedure in the wiki.
If anyone knows where the proper place would be, then please add something like
this into there:
{code}
If uninstalling Watir then make sure that you're also uninstall the same
versions of Firewatir and Commonwatir:
gem uninstall watir firewatir commonwatir
{code}
> uninstalling watir 1.6.7 does not uninstall commonwatir 1.6.7 and firewatir
> 1.6.7
> ---------------------------------------------------------------------------------
>
> Key: WTR-464
> URL: http://jira.openqa.org/browse/WTR-464
> Project: Watir
> Issue Type: Bug
> Components: Gem installer
> Affects Versions: 1.6.7
> Environment: win xp ie7
> Reporter: Alan Baird
> Assignee: Jarmo Pertman
> Priority: Major
> Fix For: Never
>
>
> After uninstalling watir 1.6.7, and installing watir 1.6.6, Watir throws a
> LoadError trying to load watir/ie. I looked at the versions that were
> installed and noticed that commonwatir and firewatir did not get uninstalled
> when Watir::IE was uninstalled. The workaround is to manually uninstall
> commonwatir and firewatir.
> N:\gauntlet>irb --noreadline
> irb(main):001:0> require 'watir'
> => true
> irb(main):002:0> br = Watir::IE.new
> LoadError: no such file to load -- watir/ie
> from (irb):2
> irb(main):003:0> br = Watir::Browser.new
> Watir::Exception::UnableToStartJSShException: Unable to connect to machine :
> 127.0.0.1 on port 9997. Make sure that JSSh is properly installed and Fir
> efox is running with '-jssh' option
> from
> c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/firefox.rb:156:in
> `set_defaults'
> from
> c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/firefox.rb:50:in
> `initialize'
> from
> c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.7/lib/watir/browser.rb:65:in
> `new'
> from
> c:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.7/lib/watir/browser.rb:65:in
> `new'
> from (irb):3
> irb(main):004:0> exit
> # uninstall commonwatir and firewatir
> N:\gauntlet>gem uninstall commonwatir -v 1.6.7
> You have requested to uninstall the gem:
> commonwatir-1.6.7
> firewatir-1.6.7 depends on [commonwatir (= 1.6.7)]
> If you remove this gems, one or more dependencies will not be met.
> Continue with Uninstall? [Yn] y
> Successfully uninstalled commonwatir-1.6.7
> N:\gauntlet>gem uninstall firewatir -v 1.6.7
> Successfully uninstalled firewatir-1.6.7
> # test to see if Watir works
> N:\gauntlet>irb --noreadline
> irb(main):001:0> require 'watir'
> => true
> irb(main):002:0> br = Watir::Browser.new
> => #<Watir::IE:0x40f7d88 url="about:blank" title="">
> irb(main):003:0> br.close
> => nil
> irb(main):004:0> br = Watir::IE.new
> => #<Watir::IE:0x40f0e84 url="about:blank" title="">
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development