为什么会有WatiN?

给用户提供一个.Net平台下,将Web测试自动化的便捷途径。

如何通过WatiN来进行自动化测试的呢?

摆事实,讲道理,乃严谨的科学态度,到底WatiN下的自动化测试如何便捷呢?

        [Test]
       
public void SearchForWatiNOnGoogle()
        {
           
// 打开IE浏览器,并来到Google站点  
            using (var browser = new IE("http://www.google.com"))
            {
               
// 定位到搜索框,并输入WatiN  
                browser.TextField(Find.ByName("q")).TypeText("WatiN");
               
// 点击“搜索”按钮  
                browser.Button(Find.ByName("btnG")).Click();
               
// 验证搜索结果中是否包含关键字“WatiN”  
                Assert.IsTrue(browser.ContainsText("WatiN"));
            }
        } 

相关文章:

  • 2021-05-21
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2021-12-17
  • 2022-12-23
  • 2021-06-08
猜你喜欢
  • 2021-08-15
  • 2021-12-15
  • 2021-07-20
  • 2021-11-02
  • 2021-11-05
  • 2021-06-16
  • 2021-07-15
相关资源
相似解决方案