2
錯誤:類型或命名空間名稱「硒」找不到(是否缺少using指令或程序集引用?)錯誤上的Visual Studio安裝硒在2010
代碼IDE生成
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using Selenium;
namespace SeleniumTests
{
[TestFixture]
public class Untitled
{
private ISelenium selenium;
private StringBuilder verificationErrors;
[SetUp]
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.ehow.com/");
selenium.Start();
verificationErrors = new StringBuilder();
}
[TearDown]
public void TeardownTest()
{
try
{
selenium.Stop();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
Assert.AreEqual("", verificationErrors.ToString());
}
[Test]
public void TheUntitledTest()
{
selenium.Open("/tips_7490061.html");
selenium.Click("//a[contains(text(),'How to Conserve Water Usage')]");
selenium.WaitForPageToLoad("30000");
}
}
}
是的,我添加了以下文件作爲參考:nunit.framework.dll,nunit.core,Whileworks.seleniumcore,Thoughtworks.selenium.integrationTests,Thoughtworks.selenium.unitTests – ajit 2011-06-03 10:11:44
是的,我已經添加了以下文件作爲參考:nunit.framework.dll,nunit.core,Whileworks.seleniumcore,Whiletworks.selenium.in tegrationTests,Whiletworks.selenium.unitTests – ajit 2011-06-03 12:06:52