我在运行chrome时请求selenium测试但我遇到 Exception
. 帮我恳求 . 我的代码是:
using System;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using OpenQA.Selenium.Support.UI;
using System.Text;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace Acceptance_Test.Trader
{
[TestFixture]
public class AcceptenceTestBtcTraderCom
{
private IWebDriver _driver;
private StringBuilder _verificationErrors;
private string _baseUrl;
[SetUp]
public void SetupTest()
{
_driver = new ChromeDriver(); // ** exception location is this one.
WebDriver.dll中出现“OpenQA.Selenium.DriverServiceNotFoundException”类型的异常但未在用户代码中处理附加信息:chromedriver.exe文件不存在于当前目录或PATH环境变量的目录中 . 该驱动程序可以从chromedriver.storage.googleapis.com/index.html下载
1 回答
您需要添加chrome驱动程序的路径:
如果您还没有下载驱动程序,可以找到它here .