WebElement.getText and WebElement.getValue

2,228 views
Skip to first unread message

Daniel Wagner-Hall

unread,
Dec 10, 2010, 6:44:06 PM12/10/10
to selenium-developers
It seems WebElement.getText and WebElement.getValue essentially do the
same thing, except in mutually exclusive contexts (you wouldn't call
.getText and .getValue on the same element). Though it's fairly easy
to explain "Use value for form fields, and text where the text is
written on the page", it's been an intuitive issue with every
developer and tester I've introduced to Selenium. Before the beta is
pushed out, I wanted to float the idea of merging the methods, though
I guess it's unlikely :)

Jason Leyba

unread,
Dec 11, 2010, 2:32:36 AM12/11/10
to selenium-...@googlegroups.com
If anything, getValue should be removed since it's just WebElement.getAttribute("value").


--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.


Simon Stewart

unread,
Dec 11, 2010, 6:16:46 AM12/11/10
to selenium-...@googlegroups.com
I've been wondering about this too. The only reason not to put the
deprecated tag on that method right now is that it makes interacting
with forms (a pretty common use case) simpler. OTOH, most form
interactions are "write mostly", so perhaps I worry to much.

Simon

Reply all
Reply to author
Forward
0 new messages