Thanks Željko!

1.  I used the require 'spec' so that I could execute the script in
SciTE to check for simple errors before running spec from the command
line.  To your point, I will make sure not to include it on future
scripts.

2.  Agree with you on the before(:all)/(:each) - I'm still figuring
out how that works practically in my tests.

> What is this?
>
> @browser ||= Watir::Browser.new

3.  I actually took that from the RSpec example here:
http://wiki.openqa.org/display/WTR/RSpec
I hate to admit that I implemented it without knowing exactly what it
did, but in testing it did not seem to change behavior.  I have not
used it with any other scripts but this first venture into RSpec.


On Feb 24, 10:01 am, Željko Filipin <zeljko.fili...@wa-research.ch>
wrote:
> Hi,
>
> Comments are inline.
>
> On Wed, Feb 24, 2010 at 4:51 PM, Adam Reed <reed.a...@gmail.com> wrote:
> > require 'spec'
>
> You do not need this. Execute tests with `spec search_spec.rb` and it just
> works.
>
> >  before(:each) do
> >   �...@browser ||= Watir::Browser.new
> >   �...@browser.goto("http://www.######.com";)
> >  end #before
>
> >  after(:each) do
> >   �...@browser.close unless @browser.nil
> >  end #after
>
> Why are you opening and closing the browser for every test?
>
> I would do it something like this:
>
> before(:all) do
>   @browser = Watir::Browser.new
> end #before
>
> before(:each) do
>   @browser.goto("http://www.######.com";)
> end #before
>
> after(:all) do
>   @browser.close unless @browser.nil
> end #after
>
> What is this?
>
> @browser ||= Watir::Browser.new
>
> Should it be just this?
>
> @browser = Watir::Browser.new
>
> Željko
> --
> watir.com - community manager
> pledgie.com/campaigns/2982 - donate to Watir
> watirpodcast.com - host
> testingpodcast.com - podcasts on software testing. all of them

-- 
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 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to