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

后端 未结 5 1851
深忆病人
深忆病人 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条回答
  •  -上瘾入骨i
    2021-02-19 00:55

    You can also use:

    new SelectElement(driver.FindElement(By.Id("")).SelectByText(""));
    

    Or:

    new SelectElement(driver.FindElement(By.Id("")).SelectByValue(""));
    

提交回复
热议问题