代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using WatiN.Core;
using System.Threading;
namespace WatiNTest
{
class Program
{
[STAThread]
static void Main(string[] args)
{
// Open a new Internet Explorer window and
// goto the google website.
IE ie = new IE("http://www.google.com.hk", true);
// Find the search text field and type Watin in it.
ie.TextField(Find.ByName("q")).TypeText("WatiN");
// Click the Google search button.
ie.Button(Find.ByValue("Google 搜索")).Click();
// Uncomment the following line if you want to close
// Internet Explorer and the console window immediately.
//ie.Close();
}
}
}
已经引入WatiN.Core.dll
如图,求解
