我尝试运行此代码。没有显示错误或警告,但没有输出。请指教。
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
class EntryPoint
{
static void Main()
{
IWebDriver driver = new ChromeDriver(@"C:\Program Files (x86)\dotnet");
driver.Navigate().GoToUrl("http://testing.todvachev.com/selectors/name/");
IWebElement element = driver.FindElement(By.Name("myName"));
if (element.Displayed)
{
System.Console.WriteLine("Yes I can see the Element!");
}
else
{
System.Console.WriteLine("It is something wrong!");
}
driver.Quit();
}
}