After reading the discussion on stack-overflow, I was already thinking that Watir's text method should probably restrict itself to visible text as well. http://stackoverflow.com/questions/2733080/does-watirs-browser-text-include-count-text-inside-invisible-divs-if-so-how-t
Jari, thanks for chiming in on this. Compatibility was another concern, and it seems also another argument for not including visible text in the string returned. Bret On Wed, May 5, 2010 at 10:07 PM, Jari Bakken <[email protected]> wrote: > On Thu, May 6, 2010 at 12:15 AM, Ethan <[email protected]> wrote: > > Having realized from this discussion that in some places in my > application, > > I really ought to be checking for visible text, not just text, I went > ahead > > and implemented this for vapir. > > I should add that neither Celerity nor watir-webdriver returns > non-visible text for Browser#text or Element#text. That decision is > made by the underlying libraries, and not really feasible to work > around. > > The Javascript algorithm used to get text in Firefox/Chrome is here: > > > http://code.google.com/p/selenium/source/browse/trunk/firefox/src/extension/components/utils.js#340 > > I don't think this is a big deal - we've been running our tests on > both Watir and Celerity for ages without it being an issue. And a need > to do things a user wouldn't be able to in your browser tests is > usually a sign that it should be covered by tests in another part of > the stack instead. > _______________________________________________ > Wtr-development mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/wtr-development > -- Bret Pettichord Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord
_______________________________________________ Wtr-development mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-development
