Hi Mike,

What I think is the code that you are using for clicking the link will always return you the Home Link.
Your HTML code is like this:
<tr>
<td class="false" height="20"><a
href="" "n=0000")
<img height="8" width="8" src="" border="0" alt="Expand Root Node"></a>Home Node</td>
</tr>
<tr>
<td class="selected" align="left" height="20"><a
href="" "n=0001")
<img height="8" width="8" src="" border="0" alt="Expand
Node"></a>Start Node</td>
</tr>
Your watir code is:
ie.link(:url, /treeAction/).click
ie.link(:url, /treeAction/).click
The above code will always return the first link whose url matches the regular _expression_ /treeaction/. You can check this by printing the 'href' of the link on the console. You'll never be able to click on Start Node link using this code. Either you specify all the full href that distinguishes both the links or use 'text' attribute to get the link.

HTH,

Regards,
Angrez
On 10/17/05, Mike Wilson <[EMAIL PROTECTED]> wrote:
Given a _javascript_ tree which looks a bit like

- Home Node
    + Start Node

clicking on the little plus sign next to "Start Node" renders

- Home Node
    - Start Node
        + Node 1
        + Node 2
        + Node 3
        + Node 4

and again, clicking each of those will expand to more nodes.

The html to create the first 2 nodes of this tree looks a bit like:

<table>
<tr>
<td>..</td>
</tr>
<tr>
<td class="false" height="20"><a
href="" "n=0000")
<img height="8" width="8" src="" border="0" alt="Expand
Root Node"></a>Home Node</td>
</tr>
<tr>
<td class="selected" align="left" height="20"><a
href="" "n=0001")
<img height="8" width="8" src="" border="0" alt="Expand
Node"></a>Start Node</td>
</tr>
</table>

So, as you click them, the html changes to display the child nodes.

Now, if I have the following code:
ie.link(:url, /treeAction/).click
ie.link(:url, /treeAction/).click

That will work for the "Home Node", but it never sees the "Start
Node".  I want to be able to expand all nodes in the tree.  How can I
do this?

Incidentally, I saw the reference to _javascript_ trees in the FAQ, but
it didn't seem to help my situation.

Does Watir possibly do a .uniq on the link array, and so it only sees the first?

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

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

Reply via email to