[Wtr-general] BUG: Using XPath
Prema Arya
prema.arya at gmail.com
Thu Jan 25 04:20:06 EST 2007
Hi,
I was trying to get the <th> from table as asked by Brad
http://www.mail-archive.com/wtr-general@rubyforge.org/msg06677.html. I was
using element_by_xpath and it didn't work and there was no reason why it
should not work. After investigating I came across the function
"create_rexml_document_object" in watir.rb, it was using "us-ascii"
encoding. Standard says we should use UTF-8 and this article (
http://www-128.ibm.com/developerworks/xml/library/x-utf8/) also says the
same. After changing the encoding to UTF-8 I could address all the <th>
using xpath.
This change should be checked-in in the main branch also, Bret can you give
me access right to check-in? or someone else also can check-in the change.
Brad you can find <th> using xpath something like this:
th = ie.element_by_xpath("//th")
puts th.innerText
th = ie.elements_by_xpath("//th")
for h in th do
puts h.innerText
end
Thanks
--
Prema Arya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070125/15534db9/attachment.html
More information about the Wtr-general
mailing list