The problem is that there is no good spec about exactly what the exact text
that should be returned by IE#text. We fixed some of the incompatibilities
between how this worked on IE and Firefox, but I am sure there are more
differences, e.g. encodings and whitespace and the like.

Although I see a lot of value for an Element#visible? method it would be
quite difficult to write IE#visible_text because it would be complex and
frankly any one who was smart enough to do a good job writing it would also
be smart enough to know that they shouldn't use it.

Because, in the end using IE#text means you are checking all the text of the
page, and it is a better testing approach to be more narrow in what you
test.

Bret

On Mon, May 3, 2010 at 10:47 AM, Jarmo <[email protected]> wrote:

> Could you be more specific (and bring some concrete example) what's
> bad about using IE#text.include?
>
> Jarmo
>
> On Mon, May 3, 2010 at 6:22 PM, Bret Pettichord <[email protected]>
> wrote:
> > Good question.
> >
> > I am talking about (and arguing agains) using the text method on the IE
> > object itself (IE#text), not using on specific elements on a page.
> >
> > Bret
> >
> > On Sun, May 2, 2010 at 9:26 PM, Alan Baird <[email protected]> wrote:
> >>
> >> > Also, pretty reluctant to add any methods that will be hard to
> implement
> >> > in
> >> > different implementations. As it is already, the "text" method is not
> >> > compatible between versions and we should really be encouraging people
> >> > not
> >> > to use it. I don't think it really is a good practice any way.
> >>
> >> Bret -
> >>
> >> Can you clarify this a bit?  I'm thinking you are saying it's not good
> >> practice, say, to get the text of a span by doing 'browser.span(:id,
> >> 'someid').text'.  However, I'm not sure I can immediately think of a
> >> better way of doing this other than parsing the html.  I'm pretty sure
> >> that's not what you mean.
> >>
> >> What is the better way of doing this?
> >>
> >> Alan
> >> _______________________________________________
> >> 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 <http://www.io.com/%7Ewazmo/blog>
> > Twitter, www.twitter.com/bpettichord
> >
> >
> > _______________________________________________
> > Wtr-development mailing list
> > [email protected]
> > http://rubyforge.org/mailman/listinfo/wtr-development
> >
> _______________________________________________
> 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

Reply via email to