The main class for web browsing. This class allows you to navigate to a specific URL. Once you navigate to one URL, you can naviage to any URL contained on the page.
Esempio n. 1
0
 public void TestBrowser()
 {
     var b = new Browser();
     b.Navigate(new Uri("http://www.httprecipes.com"));
     WebPage page = b.CurrentPage;
     Assert.IsTrue(page.Title.GetTextOnly().IndexOf("HTTP") != -1);
 }
 public void TestFormGET()
 {
     var b = new Browser();
     b.Navigate(new Uri("http://www.httprecipes.com/1/7/get.php"));
     WebPage page = b.CurrentPage;
     Assert.IsTrue(page.Title.GetTextOnly().IndexOf("HTTP") != -1);
     var form = (Form) page.Find(typeof (Form), 0);
     Input input1 = form.FindType("text", 0);
     input1.Value = "New York";
     b.Navigate(form);
     page = b.CurrentPage;
     Assert.IsTrue(page.Title.GetTextOnly().IndexOf("HTTP") != -1);
 }