How to add IEDriverServer to PATH

2019-02-21 01:45发布

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

Inserted in ClassPath Inserted in PATH Created a new variable

The path is separated by a semicolon in PATH and CLASSPATH (ex.;C:\Users\username\Downloads\IEDriverServer_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.

Also here is the error output:

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)

2条回答
ゆ 、 Hurt°
2楼-- · 2019-02-21 02:07

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

UPDATE

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

查看更多
再贱就再见
3楼-- · 2019-02-21 02:17

Unzip the IEDriver.zip file in any folder, so that folder contains IEDriver file e.g you unzipped it in C:\Drivers\

  • Copy path till that folder. means only C:\Drivers\
  • Go to My Computer -> Properties -> Advanced Settings -> Environment Variables
  • Under that in front of PATH paste our path i.e C:\Drivers\ at the end and before that put ;
  • Apply the changes made
  • Restart command prompt
查看更多
登录 后发表回答