我用 selenium 记录器创建了一个小脚本,并将其导出到 ac# 文件,selenium 在其上创建了很多代码行,但一些属性如下:
[TestFixture]
public class TestinGSelenium
{
private IWebDriver driver;
private StringBuilder verificationErrors;
private string baseURL;
private bool acceptNextAlert = true;
[SetUp]
public void SetupTest()
{
driver = new FirefoxDriver();
baseURL = "http://www.google.it/";
verificationErrors = new StringBuilder();
}
[TearDown]
public void TeardownTest()
{
try
{
driver.Quit();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
NUnit.Core.NUnitFramework.Assert.AreEqual("", verificationErrors.ToString());
}
Visual Studio 无法验证关于:[TestFixture] [TearDown] [SetUp] 的属性我添加了对:“NUnit”和“selenium”的引用,但继续返回错误。我还可以做些什么?运行这个 c# 脚本?
感谢您的任何建议