The page I'm trying to check has a span element that actually functions as a drop-down menu. Selenium code for select elements does not work and produces the following:
Exception in thread "main" org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "span"
The code for this element is as follows:
<span style="width: 100%" val="30" id="countVal">30</span>
Code when opening the dropdown menu:
<tr onclick="selectNewCount(1);" class="selec_option"> <td onmouseout="blankit(this)" onmouseover="colorit(this)" class="bones_pointer out_color" id="tdgroup1">50</td> </tr>
Here's what it looks like:

EDIT 1:
This is my Selenium code:
// choose number of records. try { WebDriverWait wait = new WebDriverWait(driver, /*seconds=*/10); element = wait.until(presenceOfElementLocated(By.id("countVal"))); Select select = new Select(element); select.deselectAll(); select.selectByVisibleText("100"); } catch (NoSuchElementException ex) { System.out.println("PAGE SOURCE: \n" + driver.getPageSource()); ex.printStackTrace(); }
Here's what the source code of the page looks like around this element:

I can add additional information if required. Thanks.
source share