C# testfixturesetup在程序中失败
我在用C语言编写自动化程序。我写了这段代码,测试一直失败。你认为问题是什么?chrome打开了,但它没有谷歌C# testfixturesetup在程序中失败,c#,selenium,C#,Selenium,我在用C语言编写自动化程序。我写了这段代码,测试一直失败。你认为问题是什么?chrome打开了,但它没有谷歌 namespace ConsoleApplication4Sel { class Program { IWebDriver driver = new ChromeDriver(); static void Main(string[] args) { } [SetUp]
namespace ConsoleApplication4Sel
{
class Program
{
IWebDriver driver = new ChromeDriver();
static void Main(string[] args)
{
}
[SetUp]
public void initialization()
{
driver.Navigate().GoToUrl("http://www.google.com");
}
[Test]
public void ExcuteTest()
{
IWebElement element = driver.FindElement(By.Name("q"));
//perform ops
element.SendKeys("Execute authomation");
}
[TearDown]
public void CleanUp()
{
driver.Close();
}
}
}
请发布您收到的错误。 但无论如何,您忘了将路径链接到驱动程序,这意味着:
IWebDriver driver = new ChromeDriver(@"YOUR_PATH");
将您的路径放在那里,例如D:\Download\chromedriver