[Wtr-development] Watir::Browser.attach

Gavin Jefferies gavin at vmbed.com
Mon Dec 1 20:53:27 EST 2008

Hi Bret,

Thanks. Some comments from me below.


On Mon, Dec 1, 2008 at 4:56 PM, Bret Pettichord <bret at pettichord.com> wrote:
> Gavin,
> Thanks for submitting this. I've taken a quick look at your code, and i
> think it will help us get moving in the right direction. I do see that some
> more changes will be needed to the code than what you have here, but like I
> said a good start. Frankly, I've been putting this off because I knew there
> were several loose threads involved.

Yes I see this as an incremental step towards creating a more uniform
interface for the attach functionality but by no means the whole or
even most of the way there.

> I like the extra tests you write, but I also want to update our existing
> tests of IE.attach to test this new code.

The test I added started as a copy of
watir/unittests/windows/attach_to_existing_window_test.rb which should
probably be deleted then if this gets checked in.

> I will respond to some of your questions below.
> On Sat, Nov 22, 2008 at 5:45 PM, Gavin Jefferies <gavin at vmbed.com> wrote:
>> Hi Folks,
>> Attached is my attempt to create a firewatir class attach method and a
>> Watir::Browser.attach method so that it can be used across ie and
>> firefox. Given that this is my first attempt to modify the watir code,
>> I expect that it will need changes, or may be completely off the ball,
>> or not conform to the direction of the project etc. So have at it.
>> A couple of things:
>> 1. Do all cross browser class methods have to live in browser.rb like
>> that?
> I don't understand the question. Putting the class methods in browser.rb is
> the most obvious way to organize the code. There are other ways as well. Do
> you have a problem with this approach? Did you want to suggest something
> else?

That works fine. I think I was concerned it will get tiresome after a
while having to add a dispatch method in their for every common
method. But I'm not a Ruby expert and cannot think of another way to
do it. Now if it was Perl....

>> 2. If I don't have that require 'watir/ie' at the start of the unit
>> test I keep getting a commonwatir/lib/watir/browser.rb:90:in `klass':
>> (eval):1:in `klass': uninitialized constant Watir::IE (NameError) it
>> looks like the autoload is not working for me but I'm at a loss to
>> figure out why.
> I was not able to reproduce this problem.
> --
> Bret Pettichord
> GTalk: bpettichord at gmail.com
> CTO, WatirCraft LLC, http://www.watircraft.com
> Lead Developer, Watir, http://wtr.rubyforge.org
> Blog (Essays), http://www.io.com/~wazmo/blog
> MiniBlog (Links), http://feeds.feedburner.com/bretshotlist
> _______________________________________________
> Wtr-development mailing list
> Wtr-development at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-development

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

More information about the Wtr-development mailing list