How to get all options in a drop-down list by Selenium WebDriver using C#?

后端 未结 11 856
闹比i
闹比i 2020-12-30 02:30

I\'m new to both C# and Selenium WebDriver.

I know how to select/click on an option in a drop-down list, but I\'ve a problem before that. Since the drop-down list i

11条回答
  •  情歌与酒
    2020-12-30 02:53

    Make sure you reference the WebDriver.Support.dll assembly to gain access to the OpenQA.Selenium.Support.UI.SelectElement dropdown helper class. See this thread for additional details.

    Edit: In this screenshot, you can see that I can get the options just fine. Is IE opening up when you create a new InternetExplorerDriver? Screenshot

提交回复
热议问题