1.6.2: Issue with enabled_popup.rb

112 views
Skip to first unread message

jpweston

unread,
Nov 12, 2008, 6:12:28 PM11/12/08
to Watir General
After installing WATIR 1.6.2, scripts that have the following line:
require 'watir/contrib/enabled_popup' are causing the following error:

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/contrib/
enabled_popup.rb:5: uninitialized constant Watir::PageContainer::Win32
(NameError)
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'

Here is what I have at the top of my scripts:

require 'test/unit'
require 'ci/reporter/rake/test_unit_loader.rb'
require 'watir'
require 'watir/testcase'
require 'watir/contrib/enabled_popup'

class TC_sales_tests < Watir::TestCase

include Watir

<code>

end

Can someone point me toward what I am doing wrong here? These scripts
worked with the version of 1.5 that I had installed.

Thanks.

Johnathan

Bret Pettichord

unread,
Nov 13, 2008, 12:17:33 AM11/13/08
to watir-...@googlegroups.com
the solution is to add "require 'watir/ie'" to your script

jpweston

unread,
Nov 13, 2008, 12:33:34 PM11/13/08
to Watir General
Thanks for this and your explanation in the "Uninitialzied Constant"
post.

j.

Bret Pettichord

unread,
Nov 13, 2008, 1:06:32 PM11/13/08
to watir-...@googlegroups.com
i've added the require statement to the enabled popup script itself, so
this workaround will not be required with the next version of watir

Lisa Crispin

unread,
Nov 28, 2008, 5:14:23 PM11/28/08
to watir-...@googlegroups.com
Hi Bret,
Just to clarify - So for now we have to use require 'watir\ie' in order to require 'watir\contrib\enabled_popup', but in the next version, we won't have to use require 'watir\ie', correct?

My next question may be ignorant - if we want to be able to run our scripts in firewatir as well as watir, does that mean we can't use this enabled_popup thing to deal with modal dialogs? In that case, how DO we deal with modal dialogs?
thanks,
Lisa

Bret Pettichord

unread,
Dec 2, 2008, 8:23:03 PM12/2/08
to watir-...@googlegroups.com
The reason that enabled popup is in "contrib" is to indicate that it is
unsupported code.

I've never used Watir's modal dialog support for production testing
(except for showModalDialogs, which i've used and which IMHO has
excellent support). The support for the other modal dialogs needs work
simply for IE much less working on how to make this work cross-platform.
Some of this code is not in contrib, although it probably should be.

I've always found it easier to avoid dealing with modal dialogs, so I've
never had personal motivation to work on this code.

I've considered removing the nascent support for modal dialogs from
Watir entirely (perhaps bundling as a separate gem), to help telegraph
that this code is not being maintained or supported. Perhaps this would
help this code find a new owner.

Bret

Lisa Crispin wrote:
> Hi Bret,
> Just to clarify - So for now we have to use require 'watir\ie' in
> order to require 'watir\contrib\enabled_popup', but in the next
> version, we won't have to use require 'watir\ie', correct?
>
> My next question may be ignorant - if we want to be able to run our
> scripts in firewatir as well as watir, does that mean we can't use
> this enabled_popup thing to deal with modal dialogs? In that case, how
> DO we deal with modal dialogs?
> thanks,
> Lisa
>
> On Thu, Nov 13, 2008 at 11:06 AM, Bret Pettichord <br...@pettichord.com
> <mailto:br...@pettichord.com>> wrote:
>
>
> i've added the require statement to the enabled popup script
> itself, so
> this workaround will not be required with the next version of watir
>
> jpweston wrote:
> > Thanks for this and your explanation in the "Uninitialzied Constant"
> > post.
> >
> > j.
> >
> > On Nov 12, 9:17 pm, Bret Pettichord <b...@pettichord.com

Lisa Crispin

unread,
Dec 3, 2008, 12:27:45 PM12/3/08
to watir-...@googlegroups.com
As someone whose programming skills are limited, and who primarily works as a tester, it's hard for me to understand what you're saying.

We've been running a big Watir suite for a few years now and it has handled our modal dialogs fairly well up to now. That took a bit of doing but we got it stable.

I don't know what showModalDialogs is so I need to go look that up - would that solve our problem of being able to close the modal dialogs?

Or are you saying modal dialogs aren't really supported? If that is true, are these our only choices:
1. Go back to the previous version of Watir and stay there forever, or until modal dialog support is provided (which sounds chancy as apparently we're the only ones using modal dialogs a lot?)
2. Dump Watir and look for another tool - we have a huge investment in our scripts and depend on them and I really don't want to do that.

Am I overreacting - I just don't quite understand what you're saying.

Thanks,
Lisa
--
Lisa Crispin
Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers and Agile Teams_ (Addison-Wesley 2009)
http://www.agiletester.ca
http://lisa.crispin.home.att.net
http://lisacrispin.blogspot.com

Bret Pettichord

unread,
Dec 3, 2008, 4:47:04 PM12/3/08
to watir-...@googlegroups.com
I'm saying that I do not have a plan on how to support modal dialog
testing that will work with both IE and Firefox, and as far as I know,
no one else is working on this.

Bret
> > <mailto:br...@pettichord.com <mailto:br...@pettichord.com>>> wrote:
> >
> >
> > i've added the require statement to the enabled popup script
> > itself, so
> > this workaround will not be required with the next version
> of watir
> >
> > jpweston wrote:
> > > Thanks for this and your explanation in the "Uninitialzied
> Constant"
> > > post.
> > >
> > > j.
> > >
> > > On Nov 12, 9:17 pm, Bret Pettichord <b...@pettichord.com
> <mailto:b...@pettichord.com>
> > <mailto:b...@pettichord.com <mailto:b...@pettichord.com>>>

Lisa Crispin

unread,
Dec 3, 2008, 4:51:23 PM12/3/08
to watir-...@googlegroups.com
Oh, ok. That kinda sucks, but we were already used to not being able to run the suites w/ firefox. But just to make sure - should it work with IE in the latest version?
thanks,
Lisa

Charley Baker

unread,
Dec 3, 2008, 5:07:02 PM12/3/08
to watir-...@googlegroups.com
I'm not sure if we're sidetracked or not. The modal dialog support is included in Watir 1.6.2. Modal dialogs in the sense I'm talking about are specific to IE, not Firefox - this is IE specific, with calls to showmodal. I'll reiterate, this is IE only and a piece of something to deal with. The naming is poor since there are "modal dialogs" which are essentially JS or browser dialogs which are also in the true sense modal dialogs. 

I'm confused as to which modal dialogs you are referring to. Both are supported in the current version of Watir. 


Charley Baker
blog: http://charleybakersblog.blogspot.com/
Project Manager, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct

Lisa Crispin

unread,
Dec 3, 2008, 5:13:59 PM12/3/08
to watir-...@googlegroups.com
OK, I will keep plunging ahead and trying to get 1.6.2 working on my Vista (I am still having issues with the suites, windows are not closing like they should, although they did in the previous Watir version I had on my XP/IE7), then see if I can get it working on firefox later.
thanks!
Lisa
Reply all
Reply to author
Forward
0 new messages