I am trying to control page by Selenium. I have a problem with listbox. This is how it looks:
<span title="" class="k-widget k-dropdown" unselectable="on" role="listbox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-owns="ddlRetentionCategory_listbox" aria-live="polite" aria-disabled="false" aria-busy="false" style="" aria-activedescendant="3d9fac25-2597-4668-82d0-c00a04131818"><span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">--Select--</span><span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-60-down"></span></span></span><input id="ddlRetentionCategory" name="ddlRetentionCategory" type="text" value="" data-role="dropdownlist" style="display: none;" aria-required="true" aria-invalid="true"></span>
and this is what I need to select from dropdown/listbox:
<span title="" class="k-widget k-dropdown" unselectable="on" role="listbox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-owns="ddlRetentionCategory_listbox" aria-live="polite" aria-disabled="false" aria-busy="false" style="" aria-activedescendant="3d9fac25-2597-4668-82d0-c00a04131818"><span unselectable="on" class="k-dropdown-wrap k-state-default k-state-focused"><span unselectable="on" class="k-input">2 years</span><span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-60-down"></span></span></span><input id="ddlRetentionCategory" name="ddlRetentionCategory" type="text" value="" data-role="dropdownlist" style="display: none;" aria-required="true" aria-invalid="true"></span>
driver.execute_script("document.getElementById('ddlRetentionCategory').value=\"2 years\"")