Created
July 25, 2011 14:27
-
-
Save bramhaghosh/1104236 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def checkbox(name, identifier) | |
define_method("#{name}") do | |
send("#{name}_rendered?") | |
browser.checkbox(identifier) | |
end | |
define_method("check_#{name}") do | |
send("#{name}_rendered?") | |
times_retried = 0 | |
begin | |
browser.checkbox(identifier).set | |
rescue WIN32OLERuntimeError, | |
Watir::Exception::ObjectDisabledException, | |
Watir::Exception::NoValueFoundException, | |
Watir::Exception::UnknownObjectException => exception | |
raise exception if times_retried >= 5 | |
sleep 1 | |
times_retried += 1 | |
retry | |
end | |
end | |
define_method("unchec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment