Locating element by id command works in Selenium ide but not in Java
<p>I had an issue trying to locate a dropdown box.  I got it to work with an absolute path but not with the actual xpath or id of the element.  It is super frustrating and just cant figure it out.</p>

<p>I installed Selenium IDE to see if it would work there and selenium IDE picks up the dropdown box.  I exported this test to JAVA/JUNIT and copied and pasted the command I needed into my existing test.  The command which worked in Selenium id was:</p>

<pre><code>Command: select
Target: id=z_be
Value: label=All conditions must be met
</code></pre>

<p>I exported this to java:</p>

<pre><code>new Select(driver.findElement(By.id("z_be"))).selectByVisibleText("All conditions must be met");
</code></pre>

<p>but I get the error:</p>

<pre><code>UnexpectedTagNameException: Element should have been "select" but was "div"
</code></pre>

<p>This issue is driving me crazy and would love it if someone can point me in the right direction and show me the errors of my ways.  The html is:</p>

<pre><code>&lt;select id="z_be" class="vui-input d2l-select" name="z_be" style="background-color: rgb(255, 255, 255);"&gt;
&lt;option value="1"&gt;All conditions must be met&lt;/option&gt;
&lt;option value="2" selected="selected"&gt;Any condition must be met&lt;/option&gt;
&lt;/select&gt;
</code></pre>