POM with Selenium.Support.UI and DropDown Menus



I read the article of “DropDown & Multiple Select Operations in C#” in ToolsQA web site. It explains fine about using SelectElement type of Selenium.Support.UI class

But couldn’t figure out how to use is in a Page Object Model. In the page I use



[FindsBy(How = How.CssSelector, Using = "#pie_register > li:nth-child(3) > div > div.radio_wrap > input:nth-child(6)")]

public IWebElement CricketCheckBox { get; set; }

style definitions. And initializing the elements on a Pages class with the driver. My page does not have direct access to driver.

Can anyone give me an idea how to fix the problem?



Add Comment
  • 1 Answer(s)
    Best answer

    Found the solution myself. And wanted to share here as the community may need.


    [FindsBy(How = How.Name, Using = "dropdown_7")]
    public IWebElement CountrySelect { get; set; }
    public SelectElement SelectCountry
    get { return new SelectElement(CountrySelect); }
    Default Answered on May 24, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.