Selenium fails to change dropdown selection
<p>Here is the isolated HTML code:</p>

<pre><code>&lt;span style="position: relative; width: 100%; display: inline-block;"&gt;
    &lt;select id="0ac88542d16d6200fb983d094f655c76_select" class="form-control"&gt;
        &lt;option value="display_value"&gt;Number&lt;/option&gt;
        &lt;option value="sys_class_name"&gt;Type&lt;/option&gt;
    &lt;/select&gt;
&lt;/span&gt;
</code></pre>

<p>Using Python Selenium, click on the dropdown element to expand it:</p>

<pre><code>search_elemets = driver.find_elements_by_xpath("//*[@class='form-control']")
search_elemets[0].click()
</code></pre>

<p>Now let's try different scenarios to change its selection to the desired value..</p>

<p>Option 1</p>

<pre><code>Select(search_elemets[0]) \
    .select_by_visible_text("Number")
driver.find_elements_by_tag_name('option')[1].click()
</code></pre>

<p>Option 2</p>

<pre><code>Select(search_elemets[0]) \
    .select_by_value("display_value")
driver.find_elements_by_tag_name('option')[1].send_keys(Keys.RETURN)
</code></pre>

<p>Option 3</p>

<pre><code>for option in search_elemets[0].find_elements_by_tag_name('option'):
    if option.text == 'Number':

        # Use one of the options below
        # Option 3.1
        Select(search_elemets[0]) \
            .select_by_visible_text("Number")
        option.click()
        break

        # Option 3.2
        actions = ActionChains(driver)
        actions.move_to_element(option)
        actions.click(option)
        actions.perform()
        break
</code></pre>

<p>All tries result in a visual click which is performed by the webdriver, but
the value is not changed afterwards..</p>

<p>I'm not sure why the action chain isn't working I've used that on styled options and had it work. But if you don't care about mimicking the  user behavior exactly as it will occur you can use this to change the option.</p>

<pre><code>        option = driver.find_element_by_xpath("//select[@id='0ac88542d16d6200fb983d094f655c76_select']/option[@value='sys_class_name']")
        option.click()
</code></pre>

<p>Or even just</p>

<pre><code>        driver.find_element_by_xpath("//select[@id='0ac88542d16d6200fb983d094f655c76_select']/option[@value='sys_class_name']").click()
</code></pre>

python html selenium selenium-webdriver drop-down-menu