title: Selenium in Python: Selecting an Option
body: <p>I am having no luck selecting an option from a <code>&lt;select&gt;</code> using selenium.  I have referenced <a href="https://sqa.stackexchange.com/questions/1355/what-is-the-correct-way-to-select-an-option-using-seleniums-python-webdriver">https://sqa.stackexchange.com/questions/1355/what-is-the-correct-way-to-select-an-option-using-seleniums-python-webdriver</a></p>
  
  <p>The html code is as follows: </p>
  
  <pre><code>&lt;select name="Dropdownlistrequests" onchange="javascript:setTimeout(&amp;#39;__doPostBack(\&amp;#39;Dropdownlistrequests\&amp;#39;,\&amp;#39;\&amp;#39;)&amp;#39;, 0)" id="Dropdownlistrequests" style="height:51px;width:174px;Z-INDEX: 104; LEFT: 280px; POSITION: absolute; TOP: 72px"&gt;
      &lt;option selected="selected" value="1"&gt;Previous Days&lt;/option&gt;
      &lt;option value="2"&gt;Previous Month&lt;/option&gt;
      &lt;option value="3"&gt;Last 12 Hours&lt;/option&gt;
      &lt;option value="4"&gt;Demand Poll&lt;/option&gt;
      &lt;option value="6"&gt;Custom&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I have tried </p>
  
  <pre><code>requests = driver.find_element_by_id("Dropdownlistrequests")
  requests.click()
  for option in requests.find_elements_by_tag_name('option'):
      if option.text == "Custom":
          option.click()
          break
  </code></pre>
  
  <p>And</p>
  
  <pre><code>requests = Select(driver.find_element_by_id("Dropdownlistrequests"))
  requests.select_by_value("6")
  </code></pre>
  
  <p>And</p>
  
  <pre><code>b.find_element_by_xpath("//select[@id='Dropdownlistrequests']/option[text()='Custom']").click()
  </code></pre>
  
  <p>Instead of selecting the appropriate option the browser does nothing and moves on to the next bit of code.  Could it have something to do the the javascript that is triggered by the onchange?</p>
  
  <p><strong>To provide some more context</strong>: I am running windows 7 enterprise and using selenium with marionette and Firefox developer edition 49.0a2</p>
  
  <p><strong>Update:</strong> This only sems to happen when usoing Marionette in python. I tried this same code in Java with and without Marionette and it worked</p>