I have test cases which selects each option in a dropdown but no matter what I do currently I'm getting this error.
Result Message: System.InvalidOperationException : Element is not clickable at point (1170.0333251953125,405.4250030517578) because another element obscures it
<div class="btn-group bootstrap-select">
<button type="button" class="btn dropdown-toggle btn-default" data-toggle="dropdown" role="button" data-id="year" title="2018" aria-expanded="false">
<span class="filter-option pull-left">2018</span>
<span class="bs-caret">
<span class="caret" />
</span>
</button>
<div class="dropdown-menu open" role="combobox" style="max-height: 272px; overflow: hidden; min-height: 0px;">
<ul class="dropdown-menu inner" role="listbox" aria-expanded="false" style="max-height: 260px; overflow-y: auto; min-height: 0px;">
<li data-original-index="0" class="selected">
<a tabindex="0" class="" data-tokens="null" role="option" aria-disabled="false" aria-selected="true">
<span class="text">2018</span><span class="glyphicon glyphicon-ok check-mark" />
</a>
</li>
<li data-original-index="1">
<a tabindex="0" class="" data-tokens="null" role="option" aria-disabled="false" aria-selected="false">
<span class="text">2017</span><span class="glyphicon glyphicon-ok check-mark" />
</a>
</li>
</ul>
</div>
<select aria-label="view all previous payments" class="selectpicker" data-val="true" data-val-number="The field Year must be a number." data-val-required="The Year field is required." id="year" name="Year" tabindex="-98">
<option selected="selected" value="2018">2018</option>
<option value="2017">2017</option>
</select>
</div>
Currently trying to change the year with this code -
SelectElement DropDown = new SelectElement(ObjectIdentification);
DropDown.SelectByValue(ValueToBeSelected);
return true;
With the WebElement being defined like this -
[FindsBy(How = How.XPath, Using = "//*[contains(@class, 'selectpicker')]")]
private IWebElement DropDownYear { get; set; }
This is what the dropdown looks like when selenium is trying to select pick. Nothing obscuring it that I can see.