Beispiel #1
0
 public void ScrapeUrlTest()
 {
     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.ScrapeUrl().StartsWith("about"));
     driver.Stop();
 }
Beispiel #2
0
 public void TestUrlChangeDetection()
 {
     int port = NextAvailablePort();
     ChromeDriver driver = new ChromeDriver(port);
     UrlEventHandlerCalled = false;
     driver.UrlChangeEvent += UrlEventHandler;
     driver.Start();
     Thread.Sleep(5000);
     driver.NavigateToUrl("about:blank");
     Assert.AreEqual(true, driver.WaitForUrl("about:blank"));
     Assert.AreEqual(true, driver.ScrapeUrl().StartsWith("about"));
     Assert.AreEqual(true, UrlEventHandlerCalled);
     driver.Stop();
 }
Beispiel #3
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();
 }