From: Patrick Spence Date: 2006-10-11T21:38:22+09:00 Subject: Re: Extending Watir::Checkbox class Patrick Spence wrote: > I googled "extending watir" and found this... > http://wiki.openqa.org/pages/viewpage.action?pageId=1119 Sorry 'bout the password protected site, I'd forgotten about that. Anyway, I found the following code posted: class Watir::Element # If any parent element isn't visible then we cannot write to the # element. The only realiable way to determine this is to iterate # up the DOM element tree checking every element to make sure it's # visible. def visible? # Now iterate up the DOM element tree and return false if any # parent element isn't visible or is disabled. object = document while object begin if object.style.invoke('visibility') =~ /^hidden$/i return false end if object.style.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object = object.parentElement end true end end -- Posted via http://www.ruby-forum.com/.