VS 2015 Ent .:未安装NuGet找不到Selenium ChromeDriver [英] VS 2015 Ent.: NuGet installed Selenium ChromeDriver not found

查看:126
本文介绍了VS 2015 Ent .:未安装NuGet找不到Selenium ChromeDriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用NuGet安装了Selenium.Webdriver和ChromeDriver.

I've installed Selenium.Webdriver and ChromeDriver with NuGet.

但是,当我尝试像这样创建新的ChromeDriver实例时:

However, when I try to create a new instance of ChromeDriver like this:

Instance = new ChromeDriver();

VS抛出此错误:

OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html..

该文件位于NuGet安装文件的位置:

The file is in the location where NuGet installed it:

< PATH> \ Automation \\ Opus3Automation \ bin \ Debug \. VS为什么找不到它?

<PATH>\Automation\\Opus3Automation\bin\Debug\. How come VS does not find it?

如果我使用这样的绝对文件路径作为实例创建实例,那么它将起作用:

If I create the instance with the absolute file path as argument like this, then it works:

Instance = new ChromeDriver("<PATH>\\Automation\\Opus3Automation\\bin\\Debug\\");

但这是执行此操作的错误方法,因为所有用户/计算机的绝对路径都不同.而且这不是必须的.我有一个原始的解决方案,它无需使用路径即可正常工作.但是由于某种原因,在所有新解决方案中,我 创建它根本行不通.

But that's a bad way to do this, since the absolute path is different for all users/computers. And it shouldn't be necessary. I have an original solution where it works fine without having to use the path. But for some reason, in all the new solutions I create it simply doesn't work.

简单地说:我用NuGet安装了Selenium.WebDriver和ChromeDriver库,但是VS拒绝了解它们.代码中没有错误.尝试运行该文件时,它只是找不到chromedriver.exe文件.

Simply put: I install the Selenium.WebDriver and ChromeDriver libraries with NuGet, but VS refuses to know about them. There are no errors in the code. It just doesn't find the chromedriver.exe file (which is there) when it tries to run it.

有什么想法吗?这已经让我疯狂了整整一天.我在网络上的任何地方都找不到解决方案.

Any ideas? This has been driving me absolutely crazy for a day now. I cannot find any solutions for this anywhere on the web.

..

推荐答案

弗兰克霍温,

欢迎来到MSDN论坛.

Welcome to the MSDN forum.

请参阅您的描述,您的问题与C#开发有关.由于我们的论坛是讨论VS IDE,因此我将把这个话题转移到相应的论坛上: Visual Studio语言

Refer to your description, your issue is about the C# development. Since our forum is to discuss the VS IDE, I will move this thread to the appropriate forum: Visual Studio Languages Visual C# to seek for a more professional support, thank you for your understanding.

最诚挚的问候,

萨拉


这篇关于VS 2015 Ent .:未安装NuGet找不到Selenium ChromeDriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆