jarib/watir-webdriver — Issue #110: watir-webdriver/extensions/alerts is bombing
Author: hemanth
Created: 2012-01-02 09:27:24+00:00
State: open

browser.alert do
browser.button(:id => "alert").click
end #=> "the alert message"

Above code bombs with the below message :

/var/lib/gems/1.8/gems/watir-webdriver-0.4.1/lib/watir-webdriver/elements/element.rb:262:in `assert_exists': unable to locate element, using {:tag_name=>"button", :value=>"Alert"} (Watir::Exception::UnknownObjectException)
from /var/lib/gems/1.8/gems/watir-webdriver-0.4.1/lib/watir-webdriver/elements/element.rb:74:in `click'
from t.rb:13
from /var/lib/gems/1.8/gems/watir-webdriver-0.4.1/lib/watir-webdriver/extensions/alerts.rb:24:in `alert'
from t.rb:12