Element should have been "select" but was "span" in selenium
<p>Toggle button is present in an web application similar to </p>

<pre><code>http://www.dhtmlgoodies.com/index.html?whichScript=on-off-switch
</code></pre>

<p>Search for "option two" in the above link.</p>

<p>Html code of the button is like this when turned Off</p>

<pre><code>    &lt;div class="field-block button-height"&gt;
                &lt;label style="width:175px" class="label" for="input-2"&gt;&lt;b&gt;Case Association&lt;/b&gt;&lt;sup&gt;*&lt;/sup&gt;
                &lt;span id="reqCaseAssociationTD" style="display: none;"&gt;
                        required&lt;/span&gt;
                &lt;/label&gt;
                &lt;p style="margin:0px" class="field switch"&gt;


                        &lt;label style="margin:0 0 4px" class="cb-enable"&gt;&lt;span&gt;On&lt;/span&gt;&lt;/label&gt;
                        &lt;label style="margin:0 0 4px" class="cb-disable selected"&gt;&lt;span&gt;Off&lt;/span&gt;&lt;/label&gt;
                        &lt;input type="checkbox" class="checkbox" id="caseAssociation"&gt;

                &lt;/p&gt;
                &lt;span style="margin-top:8px;margin-left:2px" data-tooltip="Simulataneous post from the same user (Twitter and Facebook) would get associated with the previous open case of the user." class="helpText showToolTip"&gt;&lt;/span&gt;
            &lt;/div&gt;
</code></pre>

<p>Html code of the button is like this when turned ON</p>

<pre><code>    &lt;div class="field-block button-height"&gt;
                &lt;label style="width:175px" class="label" for="input-2"&gt;&lt;b&gt;Case Association&lt;/b&gt;&lt;sup&gt;*&lt;/sup&gt;
                &lt;span id="reqCaseAssociationTD" style="display: none;"&gt;
                        required&lt;/span&gt;
                &lt;/label&gt;
                &lt;p style="margin:0px" class="field switch"&gt;


                        &lt;label style="margin:0 0 4px" class="cb-enable selected"&gt;&lt;span&gt;On&lt;/span&gt;&lt;/label&gt;
                        &lt;label style="margin:0 0 4px" class="cb-disable"&gt;&lt;span&gt;Off&lt;/span&gt;&lt;/label&gt;
                        &lt;input type="checkbox" class="checkbox" id="caseAssociation" checked="checked"&gt;

                &lt;/p&gt;
                &lt;span style="margin-top:8px;margin-left:2px" data-tooltip="Simulataneous post from the same user (Twitter and Facebook) would get associated with the previous open case of the user." class="helpText showToolTip"&gt;&lt;/span&gt;
            &lt;/div&gt;
</code></pre>

<p>Used the following identifiers </p>

<pre><code>    //Case Association Turned On
    @FindAll(@FindBy(how = How.CSS, using = "a.cb-enable.selected"))
    public List&lt;WebElement&gt; caseAssociationIsON;

    //Case Association Turned OFF
    @FindAll(@FindBy(how = How.CSS, using = "a.cb-disable.selected"))
    public List&lt;WebElement&gt; caseAssociationIsOFF;
</code></pre>

<p>While running using the selenium getting the error </p>

<blockquote>
  <p>org.openqa.selenium.support.ui.UnexpectedTagNameException: Element
  should have been "select" but was "span"</p>
</blockquote>

<p>How do fix this. If more details are needed, please suggest. </p>