Within each list item container, I see the ins element and also a link (<a>) element. I suspect they are perhaps superimposed.
Have you tried clicking on the link elements? (doing it by title looks like it would be ideal, but that's not supported by default so you will probably have to use class, or specify the list item if the ID values are at all predictable, and then click the link inside it. browser.li(:id, '233_1455').link(:index, 1).click #index would be 0 for watir-webdriver or watir2.0 On Aug 5, 11:45 am, andy thai <[email protected]> wrote: > Hi, > > I have a javascript tree problem where I need to search for a > particular node. To do this I need to expand each branch in order to > see the contents under the node clicked. > > The problem I am having is that the plus and minus icons aren't images > like in the example provided in "http://wiki.openqa.org/display/WTR/ > JavaScript". > > An example of the html is: > > <div class="myTree" style="border: none;"> > <div id="233" class="asyncNavTree jstree jstree-0 jstree-focused > jstree-default" style=""> > <li id="233_1238" class="jstree-closed"> > <ins class="jstree-icon"> </ins> > <a class="treeNodeLink sectionPopupInit" title="node1"> > </li> > <li id="233_1455" class="jstree-closed"> > <ins class="jstree-icon"> </ins> > <a class="treeNodeLink sectionPopupInit" title="node2"> > </li> > <li id="233_5416" class="jstree-open"> > <ins class="jstree-icon"> </ins> > <a class="treeNodeLink selectedTreeNode sectionPopupInit jstree- > clicked" title="node3"> > </li> > <li id="401_1685" class="jstree-closed"> > <ins class="jstree-icon"> </ins> > <a class="treeNodeLink sectionPopupInit" title="node4"> > </li> > > From using FireBug, the icon I want to click directs me to the line > <ins class="jstree-icon"> </ins> > > I attempted to extend watir to support this, > module Watir > class Ins < NonControlElement > TAG = 'INS' > end > end > > which allows me to navigate through the tree like I want using > indexes, but when I attempt to use > browser.ins(:class, "jstree-icon").click > the button flashes, but does not expand... > > The weird thing about this is I had it working the first time I tried > it.... I wonder why it stopped working... > > Can anyone help me? > > A summary of the above: > - I want to click the jstree icons to expand > - icons aren't images like the faq page > - I am able to iterate through the icons by extending watir > - .click method on my ins tag does not work? > > Thanks for reading -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
