【发布时间】:2018-03-02 11:58:00
【问题描述】:
我试图断言两个或多个字符串是否明显。我的代码目前只寻找“好”。有没有办法寻找“好”或“坏”?
public class Test
{
public static bool FindText()
{
var conf = Driver.Instance.FindElement(By.Id("foo"));
if (conf.Text.Contains("Good"))
{
return true;
}
throw new Exception("Text not found");
}
}
【问题讨论】:
-
您是在认真询问 or 条件在 C# 中是如何工作的,还是我遗漏了什么?
-
请在提问前做一些研究
标签: c# selenium-webdriver contains assert