Select each option in a drop down using Selenium WebDriver C#

后端 未结 5 1934
深忆病人
深忆病人 2021-02-19 00:06

I\'m not able to select options in a drop down list. I think I need to have .Select or SelectElement, but there is no such option.

Sample code:

5条回答
  •  轮回少年
    2021-02-19 00:55

    This works perfectly ...

    SelectElement selector = new SelectElement(element);
    selector.SelectByIndex(1);
    

    Where the element is your drop down box.

提交回复
热议问题