Exemplo n.º 1
0
        public void test1()
        {
            NHtmlUnit.WebClient driver = null;
            driver = new NHtmlUnit.WebClient(BrowserVersion.INTERNET_EXPLORER_11);
            driver.Options.JavaScriptEnabled           = true;
            driver.Options.ThrowExceptionOnScriptError = false;
            driver.Options.ActiveXNative = true;
            driver.Options.CssEnabled    = true;
            HtmlPage page = driver.GetHtmlPage("https://www.expedia.com/");

            Thread.Sleep(5000);
            var sp = page.GetFirstByXPath("//*[@id=\"tab - hotel - tab - hp\"]/span[2]");

            Assert.AreEqual("Google", page.TitleText);
        }