I am automating some web process but ran into some strange issue using selenium. I have:
<div data-field-name="incident_type_ids" style=""><div class="form-group" data-field-name="incident_type_ids">
<label class="col-xs-4 control-label">
Incident Type
<i class="fa fa-info-circle" rel="tooltip" title="" data-placement="right" data-original-title="The type of incident (On Closure please verify that the original type was valid)"></i>
</label>
<div class="col-xs-8 controls">
<span class="editmode">
<select name="incident_type_ids" multiple="multiple" data-placeholder="Choose Some Types" class="chosen" style="display: none;"><option class=" " value="1007" title="Asset Theft/Loss">
Asset Theft/Loss
<ul class="chosen-results"><li class="active-result" data-option-array-index="0" title="Dog">
Dog
</li><li class="active-result " data-option-array-index="1" title="Cat">
Cat
</li><li class="active-result " data-option-array-index="2" title="Mouse">
Mouse
</li><li class="active-result " data-option-array-index="3" title="Hunting">
Hunting
</li><li class="active-result " data-option-array-index="4" title="Information">
Information
</li><li class="active-result " data-option-array-index="5" title="Intelligence">
Intelligence
</li><li class="active-result " data-option-array-index="6" title="Request">
Request
</li><li class="active-result " data-option-array-index="7" title="Sky">
Sky
</li><li class="active-result " data-option-array-index="8" title="Phishing">
Phishing
</li><li class="active-result " data-option-array-index="9" title="Violation">
Violation
</li><li class="active-result " data-option-array-index="10" title="DDoS">
DDoS
</li><li class="active-result " data-option-array-index="11" title="Engineering">
Engineering
</li><li class="active-result " data-option-array-index="12" title="Intrusion">
Intrusion
</li></ul>
And if I click and select value with WebDriverWait
WebDriverWait(driver,30).until(EC.element_to_be_clickable((By.XPATH,"//div[@data-field-name='incident_type_ids']"))).click()
WebDriverWait(driver,30).until(EC.presence_of_element_located((By.XPATH,"//ul[@class='chosen-results']//li[contains(.,'Phishing')]"))).click()
I get error:
selenium.common.exceptions.ElementNotInteractableException: Message: Element <li class="result-selected"> could not be scrolled into view
It does not make any sense, because if I replace Phishing with Any other value from the drop down menu it works. So why does it only get stuck at Phising? It's not even far scroll, if I replace it with Intrusion it still works too