【发布时间】:2026-01-30 18:45:01
【问题描述】:
您好,当我使用以下代码时
IWebDriver _webDriver = new RemoteWebDriver(new Uri("http://127.0.0.1:4444/wd/hub"),
DesiredCapabilities.Chrome());
我得到以下错误
System.InvalidOperationException :驱动程序可执行文件的路径必须由 webdriver.chrome.driver 系统属性设置;有关详细信息,请参阅http://code.google.com/p/selenium/wiki/ChromeDriver。最新版本可从http://code.google.com/p/chromedriver/downloads/list下载 TearDown : System.NullReferenceException : 对象引用未设置为对象的实例。 在 OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(响应错误响应) 在 OpenQA.Selenium.Remote.RemoteWebDriver.Execute(字符串 driverCommandToExecute,Dictionary`2 参数) 在 OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) 在 Browser.cs 中的 Testframework.Browser.RemoteGoto(String browser, String url):第 86 行 在 CommonAction.cs 中的 Testframework.CommonAction.RemoteBrowser(String browser):第 70 行 在RegistrationTest.cs中的Test.RegistrationTest.InvalidRegistrationTest(字符串浏览器,字符串用户名,字符串密码,字符串确认密码,字符串安全问题,字符串安全答案,字符串错误消息文本,字符串名字,字符串姓氏):第50行 - 拆除 在 CommonAction.cs 中的 Testframework.CommonAction.CaptureScreen(String fileName):第 121 行 在 RegistrationTest.cs 中的 Test.RegistrationTest.SnapshotOnFailure():第 590 行
【问题讨论】:
标签: c# webdriver remotewebdriver