我正在學習使用「watin」進行軟件測試。目前,我想記錄如何搜索單詞測試:在google.I單元測試安裝在我的IE開發插件和
使用name.When我跑我的測試和
得到谷歌的搜索文本框和按鈕 類型i接收到此的errorMessage搜索項:無法First_test拋出異常:如何測試谷歌搜索按鈕
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WatiN.Core;
namespace Web_project_test
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void First_test()
{
IE ie = new IE("http://www.google.com");
ie.TextField(Find.ByName("q")).TypeText("Unit testing");
ie.Button(Find.ByValue("btnk")).Click();
bool Expected_Result = ie.Text.Contains("Unit testing");
Assert.IsTrue(Expected_Result);
}
}
}
請發表您的代碼。而例外。 –
我已經編輯成包括我的代碼 – kombo