# Element should have been select but was span

**URL:** <https://forum.katalon.com/t/element-should-have-been-select-but-was-span/60765>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [December 11, 2021, 3:53pm UTC](https://forum.katalon.com/t/element-should-have-been-select-but-was-span/60765 "2021-12-11T15:53:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [December 11, 2021, 4:58pm UTC](https://forum.katalon.com/t/element-should-have-been-select-but-was-span/60765/2 "2021-12-11T16:58:38Z")

</div>

Right click on the drop-down and choose, “Inspect”. Do this twice and you will get the HTML of the page and the drop-down.  
The error message indicates the drop-down “effect” is not done by a **select** tag, but by a **span** tag. Because you do not have a **select** tag, that means you will not be able to use, **selectOptionByLabel** , **selectOptionByValue** or **selectOptionByIndex**.  
If you can show the HTML, then we may be able to assist you more. The only thing I can add without the HTML is you may have to use web tables to handle the drop-down.

[How to handle Web Tables | Katalon Docs](https://docs.katalon.com/katalon-studio/docs/handle_web_tables.html)

> [@Help with Randomly selecting option from list](http://forum.katalon.com/t/help-with-randomly-selecting-option-from-list/53903/2):
>
> This might assist you. Since it is a dropdown, you probably should have just above this, WebUI.waitForElementClickable(TO), to ensure it is available. import org.openqa.selenium.WebElement as WebElement import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI def driver = DriverFactory.getWebDriver(); Random rand = new Random(); 'capture all the rows associated with list' rows\_table = driver.findElements(By.xpath('//li[@class="el-select-dropdown\_\_item"]/span')); WebUI.commen…

+++  
Edit: An alternative is if you used the Spy to detect the element, then maybe you did not touch the drop-down specific enough. You can try again to see if you get a **select** tag or a **span** tag again.

---

_[View the full topic](https://forum.katalon.com/t/element-should-have-been-select-but-was-span/60765)._
