title: Watir-webdriver keeps opening multiple browsers
body: <p>Hello StackOverflow members,</p>
  
  <p>I've been searching the site (and the rest of the web) for an answer to this question, but all my search queries returned the awesome features of Watir... I seem to be one of the few people running into this particular problem. I hope someone out there has an easy answer for me :)</p>
  
  <p>I'm working on website test automation. The current test set is written with Cucumber/Ruby/Selenium-Webdriver/Capybara. I'm personally interested in switching to Watir-Webdriver in combination with Cucumber and Ruby, but I'm struggling with the following:</p>
  
  <p>Every time I run my cucumber test, Watir opens not one, but TWO browser screens. It seems to want to initiate a blank screen (which just goes to the site I configurated as default), plus another browser screen in which the actual test steps are executed.</p>
  
  <p>Keep in mind, I'm rather new to this and I'm having this trouble when simply following a beginners tutorial. Nothing fancy as of yet.</p>
  
  <p>In my 'Support/env.rb' file, I have the following:</p>
  
  <pre><code>require "cucumber"
  require 'watir-webdriver'
  
  app_host = ENV['apphost']
  
  Before do
    @browser = Watir::Browser.start app_host, :firefox
  end
  
  
  Before  do |scenario|
    @scenario_tag = scenario.source_tag_names
    @browser.cookies.clear
  end
  
  at_exit do
    @browser.close
  end
  </code></pre>
  
  <p>The first bit in my steps file (GoogleSearch.rb -- yes it's that basic):</p>
  
  <pre><code>require_relative "../support/env"
  
  Given(/^that I have gone to the Google page$/) do
    @browser.goto 'http://www.google.com'
  end
  </code></pre>
  
  <p>Now, when I run this test, I expect just ONE browser to be initiated. But instead, the automation initiates TWO browser screens. One just stays in the background doing nothing, the other contains the test steps.</p>
  
  <p>Again, I've searched for a while now (which I'm usually pretty good at), but I haven't found the answer to my problem anywhere. The only way I got it to work, is to start with a step in my steps file, initiating a browser (instead of doing this in the env.rb file). But I don't want to start each test with opening a browser..</p>
  
  <p>Any help would be very much appreciated. If any more information from me is required, I'll update as soon as I can.</p>
  
  <p>Thanks in advance!</p>