How to click an Expand button to open a section using Selenium Webdriver C#
<p>I am having trouble clicking on an Expand button which opens a section of the page listing taxonomy checkboxes.<br>
It seems webdriver thinks it's perfoming the action to click on Expand button, but the section stays collapsed.<br>
Below is the part of the HTML</p>

<p><strong>Code</strong></p>

<pre><code>metadata-editor name="resourceModelTaxonomyTypeIds" label-text="Type" matadata-fieldname="Type" resource-id="id" selected-ids="resourceModel.TaxonomyTypeIds" required class="ng-isolate-scope"
&lt;div class="form-group" ng-class="{'has-error': (required &amp;&amp; form.$submitted &amp;&amp; !isValid)}"
  ::before
  &lt;div class="col-md-9"&gt;
  &lt;!-- ngRepeat: node in loadSelectedNodes() --&gt;
  &lt;br ng-show="loadSelectedNodes().length &gt; 0" class="ng-hide"
  &lt;button type="button" class="btn btn-sm btn-info btn-expand-taxonomy ng-pristine ng-binding ng-invalid ng-invalid-valid ng-touched" name="resourceModelTaxonomyTypeIds" ng-model="selectedIds" ng-click="toggleView(isCollapsed)"&gt;&lt;span class="glyphicon glyphicon-chevron-right" aria-hidden="true"&gt;&lt;/span&gt; Expand&lt;/button&gt;
</code></pre>

<p>Here are some of my workings which haven't worked:</p>

<p><strong>Attempt 1:</strong> I tried the simple .Click() action</p>

<pre><code>driver.FindElement(By.Name("resourceModelTaxonomyTypeIds")).Click();
</code></pre>

<p>Result: Webdriver passes the step, however nothing has happened on screen, the Expand button is still collapsed and the option are still hidden.</p>

<p><strong>Attempt 2:</strong> I tried the MoveToElement action</p>

<pre><code>Actions clickExpand = new Actions(driver);
clickExpand.MoveToElement(driver.FindElement(By.Name("resourceModelTaxonomyTypeIds"))).Click().Perform();
</code></pre>

<p>Result: Same as before, webdriver thinks everything is ok, but in reality the Expand button has still not expanded the section.</p>

<p><strong>Attempt 3:</strong>  Installed Selenium IDE, done a Record and Playback to see what it codes it as (by converting to C#)
Selenium IDE records it with the <code>.Click()</code> action as I tried in attempt 1 above.</p>

<p>I'm a bit stuck on why this won't work for this particular button.  Has anyone encountered this or dealt with these type of expand buttons?</p>

<p><em>Note:</em> Manually tested the expand button by clicking to prove button work, just webdriver doesn't seem to be doing it.</p>