I'm working on a c# selenium script where i need to select a value from the drop down list. When trying to select it , getting "Element should have been select but was span" error
I am able to get to the website, and everything is working as expected. But when trying to select the option var selectElement = new SelectElement(opt); it throws an error. I know i'm wrong somewhere, need help
var opt = driver.FindElement(By.XPath("/html/body/div[7]/div[2]/div/div[2]/span/span/span[1]"));
var selectElement = new SelectElement(opt);
System.Threading.Thread.Sleep(12000);
selectElement.SelectByText("ABN MRI");
The HTML code for the site is
<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">ABN RealPage</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>
<input id="AvidIntegration_InstanceList" style="width: 350px; display: none;" data-role="dropdownlist">
I expect it should select the desired option but here its not working.