Unable to locate element w RubyMine Prosty skrypt z tutoriala - brak wait until?

Witam

Mam taki skrypt z tutoriala i wyrzuca mi:
require ‘rubygems’
require ‘watir-webdriver’
@browser = Watir::Browser.new :firefox

def adopt_puppy_number(num)
@browser.button(:value => ‘View details’, :index => num - 1).click
@browser.button(:value => ‘Adopt Me!’).click
end

@browser.gotohttp://puppies.herokuapp.com
adopt_puppy_number 1
@browser.button(:value => ‘Adopt Another Puppy’).click
adopt_puppy_number 2

pokazuje blad:
/var/lib/gems/1.9.1/gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:536:in assert_element_found': unable to locate element, using {:value=>"View details", :index=>0, :tag_name=>"button"} (Watir::Exception::UnknownObjectException) from /var/lib/gems/1.9.1/gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:508:inassert_exists’
from /var/lib/gems/1.9.1/gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:114:in click' from /Downloads/RubymineProjects/learn_watir/thirdscript_dry.rb:6:inadopt_puppy_number’
from /Downloads/RubymineProjects/learn_watir/thirdscript_dry.rb:11:in <top (required)>' from -e:1:inload’

czy tu należy dodać jakiś element “wait until…”? W którym miejscu ?
pozdrawiam