driver.FindElement(By.Id("inputUsername")).SendKeys("aca");
driver.FindElement(By.Id("inputPassword")).SendKeys("123");
driver.FindElement(By.TagName("button")).Click();
SelectElement oSelect = new SelectElement(driver.FindElement(By.Id("selectFilterbyUser")));
oSelect.selectByText("Alex");
Do anyone have solution for the problem that i had attach in the above? Try to use SelectElement
but it displays:
The type or namespace `SelectElement` could not be found.
I tried to see the potential fixes, but it shows only three options which are
SelectElement
in a new fileSelectElement
SelectElement
Does anyone know how to solve it?
You need to make sure to reference the NuGet Package Selenium.Support.
I was having the same issue and then realized that I was only referencing the Selenium.WebDriver NuGet Package. After adding the Selenium.Support NuGet package, and adding the proper using statements. My SelectElement code successfully compiled.
The proper using statements
using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;