Ok ... I'm trying to figure out what specifically you NEED/WANT this for ???
 
What is the point of going after the DIV tag if you already know the text inside it ? 
 
... Just my question ... I'm trying to see practical use. I can see use for finding a tag based on id's &| attributes, sorry, guess I'm a little dense.
 
j.

 
On 10/4/05, Padraig O'Leary <[EMAIL PROTECTED]> wrote:

Hi,

I extended Watir Ver. 1.4.1 with the Xpath extension. However I'm having problems with the Xpath extension. It has problems identifying nodes using the text they contain. For example a node with:

                        <DIV>some text</DIV>
Xpath will have trouble finding the DIV tag using the text it contains. If I put the following code in (:xpath, "//div['some totally different text']")

It would find the above node. See the example below:

<div id="div2">
        <DIV id=spanner>bbb</DIV>
        <table id="div2-1">
                <input id="div2-2" type=submit value="Hope this works" name=btnWork/>
        </table>
        <table id="tab2-2"><tr><td id="table col">yyy</td></tr></table>
</div>

If I use this Xpath (:xpath, "//[EMAIL PROTECTED]'div2']/*/.='blah blah'") it'll fine the node <DIV id=spanner>bbb</DIV>. It finds the first element without looking at the end of the XPath statement.

You cant search for an node based on the text it contains! Will Watir Ver. 1.5 contain the same Xpath version that's now available in Head in CVS or is to plan to modify. Should I wait to see if the new version will fix this problem or go the awkward route of trying to change the way the tag elements are generated? Has anybody else come across the same problems?

Thanks a million
Pádraig


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general





--
"http://ruby-lang.org -- do you ruby?"

Jeff Wood
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to