Robot & Selenium Tree Element Expansion
<p>My supervisor has recently switched us from HP-UFT to Robot with the Selenium Webdriver and I'm finding it extremely difficult to figure out how to use the driver and/or keyword framework to expand a folding tree ul/li webelement.</p>

<p>Below is a stripped out example of the code on the page:</p>

<pre><code>&lt;ul&gt;
&lt;li class="node-class open" id="i1454430045821320"&gt;
    &lt;a class="" style="" href=""&gt;
    &lt;ins&gt;&amp;nbsp;&lt;/ins&gt;Location Header 1&lt;/a&gt;
    &lt;ul&gt;
        &lt;li class="node-instance  leaf" id="i1454430058247421"&gt;
            &lt;a class="" style="" href=""&gt;
            &lt;ins&gt;&amp;nbsp;&lt;/ins&gt;Location 1&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="node-instance  last leaf" id="i14545337159411690"&gt;
            &lt;a class="" style="" href=""&gt;
            &lt;ins&gt;&amp;nbsp;&lt;/ins&gt;Location 2&lt;/a&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/li&gt;
&lt;li class="node-class  closed " id="i14544407827351156"&gt;
    &lt;a class="" style="" href=""&gt;
    &lt;ins&gt;&amp;nbsp;&lt;/ins&gt;Location Header 2&lt;/a&gt;
&lt;/li&gt;
</code></pre>

<p></p>

<p>What I'm trying to do <em>should</em> be extremely simple: I want to expand a specifed closed tree structure if it's classed as closed. Beneath each branch is an optional nested branch, or a selection checkbox. My end goal is to be able to drill down to a location in the tree that the tester specifies and click the end leaf.</p>

<p>Using "Click Element|xpath=/ul/li[a[contains(text(),'Location Header 2')]" does expand the branch but it also selects all of the child node checkboxes.</p>

<p>In UFT, if I hit this kind of problem I'd simply change the parent <code>&lt;li&gt;</code> class to force it open (if I couldn't click or use any of the other methods to drill down and select).</p>

<p>In Robot, I can use the keyword "Get Element Attribute" to READ the class, but I don't see a keyword to CHANGE it so that idea is out. What I'm looking for is a way to expand the tree branches without inadvertently selecting all of the child nodes.</p>

<p>The drilling down through the tree portion I can deal with once I figure out how to open the nodes correctly but opening up the branch without potentially selecting all of the sub-items is making me pound my head into my desk.</p>

<p>I keep thinking that maybe I'm missing something simple. Any assistance on something that I could try would be greatly appreciated.</p>