Hi Lisa,

If you want to have one browser shared among all your tests in the
suite then a global variable set up in a mixin class may be what you
are looking for:

module MySetup
  def setup
    if $br == nil
      $br = Watir::Browser.new
    end
    @br = $br
  end
end

Then use this module in your test cases with include MySetup. Your
tests will be able to use the instance variable @br if you don't want
them to use globals.

hth,
Gavin


On Fri, Nov 28, 2008 at 2:58 PM, Lisa Crispin <[EMAIL PROTECTED]> wrote:
> Another question - on the development site you say:
> Watir 1.6.2 does not support Browser.attach. This will be supported in a
> future version.
> We use Browser.attach when we run our tests in a suite.
>
> What are we supposed to do instead, since Browser.attach isn't supported in
> 1.6.2? Or does this mean we can't use 1.6.2 at all? It seems weird that you
> couldn't run suites, there must be a way to do it that I just don't know
> about.
> Thanks,
> Lisa
>
>
> On Thu, Nov 13, 2008 at 11:06 AM, Bret Pettichord <[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]> wrote:
>> >
>> >> the solution is to add "require 'watir/ie'" to your script
>> >>
>> >> jpweston wrote:
>> >>
>> >>> 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
>> >>>
>> > >
>> >
>>
>>
>>
>
>
>
>
> >
>



-- 
VMBed - http://vmbed.com/ - Machines when you want them.
Test Automation - http://vmbed.com/?page/automate

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to