Fix the indenting of your code and it should become clear:
require 'rubygems' require 'watir-webdriver' describe 'MySite' do before(:all) { @browser = Watir::Browser.new :firefox } it 'contains "Google"' do @browser.goto 'http://google.com/' @browser.text.should include 'google' end # Code randomly in here - not in a validation or check that would have # before(:all) run before it. @browser.text_field(:xpath,"/html/body/div[@id='searchform']/ form[@id='tsf']/div/div[2]/table/tbody/tr[1]/td[1]/table/tbody/tr/ td[1]/div/table[@id='sftab']/tbody/tr/td[@id='lst-xbtn']/div/div[2]/ input").set ("ruby") @browser.button(:xpath,"/html/body/div[@id='searchform']/ form[@id='tsf']/div/div[3]/center/input[1]").click it 'contains "Ruby"' do @browser.text.should_not include 'Rails' end after(:all) { @browser.quit } end -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com