如何将 IEDriverServer 添加到 PATH如何将、IEDriverServer、PATH

2023-09-08 00:03:04 作者:倾暖未颜°墨染成画的年华

我正在详细说明我昨天提出的关于 PATH 的问题.我正在尝试在 IE 8 中运行我的硒测试.我已经下载了 IEDriverServer_x64_2.33.0,它位于我的下载文件夹中.我尝试通过以下方式添加此位置:

I am elaborating on a question I asked yesterday about PATHs. I am trying to run my selenium tests in IE 8. I have downloaded the IEDriverServer_x64_2.33.0 and it is located in my downloads folder. I have tried adding this location in the following ways:

控制面板>系统>高级>环境变量

Control Panel> System>Advanced> Environment Variables

路径在 PATH 和 CLASSPATH 中用分号分隔(例如;C:UsersusernameDownloadsIEDriverServer_x64_2.33.0)这些都不能让我的测试运行.难道是我如何关联ie浏览器?我无法在 cmd.exe 中运行驱动程序,所以我假设它不是这个.

The path is separated by a semicolon in PATH and CLASSPATH (ex.;C:UsersusernameDownloadsIEDriverServer_x64_2.33.0) Neither of these gets my test to run. Could it be how i'm associating the ie browser? I can not run the driver in cmd.exe so i have assumed it is not this.

env.rb :

require 'selenium-webdriver'
require 'rubygems'
require 'rspec/expectations'



@driver = Selenium::WebDriver.for :ie

任何建议.我希望这是足够的信息来显示我的问题.

Any advice. I hope this is enough information to show my problem.

这里也是错误输出:

Unable to find standalone executable. Please download the IEDriverServer from http://code.google.com/p/selenium/downloads/list and place the executable on your PATH. (Selenium::WebDriver::Error::WebDriverError)

推荐答案

您需要先解压缩 IEdriver zip 文件.然后在路径中提供 C:UsersmegaxelizeDownloads.IEDriver文件的路径就是IEDriver所在的文件夹"的路径.

You need to unzip the IEdriver zip file first. Then provide C:UsersmegaxelizeDownloads in the path. Path to the IEDriver file is the path of the "folder" in which the IEDriver lies.

更新

为了快速测试,只需将 IEDriver(不是 zip 文件)拖放到 `C:WindowsSystem32.然后运行你的测试.

For a quick test, just drop the IEDriver (not the zip file) and drop it in `C:WindowsSystem32. Then run your tests.