Tôi có một mã C#. (Được xuất khẩu từ selen IDE)Loại hoặc namespace tên 'NUnit' không thể tìm được
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using Selenium;
namespace SeleniumTests
{
[TestFixture]
public class csharp
{
private ISelenium selenium;
private StringBuilder verificationErrors;
[SetUp]
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://localhost:1924/");
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 TheCsharpTest()
{
selenium.Open("/cookie/Default.aspx");
selenium.Type("id=TextBox1", "ranadheer");
selenium.Type("id=TextBox2", "SE");
selenium.Type("id=TextBox3", "hyderabad");
selenium.Click("id=Button1");
selenium.WaitForPageToLoad("30000");
selenium.Click("id=Button2");
selenium.WaitForPageToLoad("30000");
}
}
}
tôi dán mã này trong một ứng dụng giao diện điều khiển (visual studio 2008).
Sau khi chạy, tôi gặp lỗi này:
Không thể tìm thấy loại hoặc không gian tên 'NUnit'.
Loại hoặc namespace tên 'TestFixture' không thể tìm được
Loại hoặc namespace tên 'ISelenium' không thể tìm được
Loại hoặc namespace tên 'SetUpAttribute' không thể tìm được
khuôn khổ gì tôi nên thêm vào để sửa lỗi này?
cảm ơn đã nhận nó ... –