[英]how to select an option from the popup dropdown list using selenium webdriver c#
[英]Is there a way to select an element that is not an option from a dropdown by text using selenium and C#
像这样的代码:
public void SideMenuNavigateTo(string menuOption)
{
this.SideMenu.FindElement(By.XPath("//a[contains(text(),'" + menuOption "')]"));
}
这段代码不起作用,但有没有办法做类似的事情?
我找到了解决我的问题的方法。 语法应该有点不同
this.Driver.FindElement(By.XPath(String.Format("//a[contains(text(), '{0}')]", menuOption)));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.