Hi Mike,
I think I'd a similar problem recently.
If I'm correct, the tree is created dynamically so that
all the links aren't available when you navigate to the
page the first time?
Could you try re-attaching to IE with a new variable
after the original link is clicked? This new ie variable
could have the updated links.
so try
ie.link(:url, /treeAction/).click
ie2 = Watir::IE.attach(:url,"<Copy and paste the exact url in IE address bar
here>" )
ie2.show_all_objects
I'm pretty sure you could just overwrite the original ie variable but I gave
it a new
name just to highlight.
Hopefully you should now be able to see the new links.
Hope that helps,
Mark.
-----Original Message-----
From: Mike Wilson [mailto:[EMAIL PROTECTED]
Sent: 17 October 2005 15:10
To: [email protected]
Subject: [Wtr-general] JavaScript Tree difficulties
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="javascript:treeAction("my_tree#MA", "n=0000")
<img height="8" width="8" src="images/plus.gif" border="0" alt="Expand
Root Node"></a>Home Node</td>
</tr>
<tr>
<td class="selected" align="left" height="20"><a
href="javascript:treeAction("my_tree#MA", "n=0001")
<img height="8" width="8" src="images/plus.gif" 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