输出不显示

时间:2019-04-20 06:32:59

标签: selenium-webdriver

我尝试运行此代码。没有显示错误或警告,但没有输出。请指教。

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();

    }
}

0 个答案:

没有答案