예제 #1
0
        public void TestTitleChangeDetection()
        {
            int port = NextAvailablePort();
            ChromeDriver driver = new ChromeDriver(port);
            TitleEventHandlerCalled = false;
            driver.TitleChangeEvent += TitleEventHandler;
            driver.Start();
            Thread.Sleep(5000);
            driver.NavigateToUrl("about:blank");
            Assert.AreEqual(true, driver.WaitForUrl("about:blank"));
            Assert.AreEqual(true, driver.WaitForTitle("about:blank"));
            Assert.AreEqual(true, TitleEventHandlerCalled);

            driver.Stop();
        }
예제 #2
0
 public void ScrapeTitleTest()
 {
     int port = NextAvailablePort();
     ChromeDriver driver = new ChromeDriver(port);
     driver.Start();
     driver.NavigateToUrl("about:blank");
     Assert.AreEqual(true, driver.WaitForUrl("about:blank"));
     Assert.AreEqual(true, driver.WaitForTitle("about:blank"));
     Assert.AreEqual(true, driver.ScrapeTitle().ToLower().Contains("blank"));
     driver.Stop();
 }