I want to install Wating for Visual Studio 2010. I saw their Video on the website, and followed the steps, but I got some errors while installing NuGet.
This is what I did now:
- New project -> C# Form
- Project -> Add reference -> Added the Net 4 DLL WatiN.Core.dll
- Added this code to my project (from their website, which is added to the source below)
And I get this errors:
'Form' is an ambiguous reference between 'System.Windows.Forms.Form' and 'WatiN.Core.Form'
'WatiN.Core.Form' does not contain a constructor that takes 0 arguments
The name 'Assert' does not exist in the current context
Here is my application code (I added using Watin.Core too):
private void Form1_Load(object sender, EventArgs e)
{
using (var browser = new IE("http://www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("WatiN");
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText("WatiN"));
}
}
What do you think ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…