Selenium webdriver 如何安装IEDriverServer_x64_389;。。在webdriver中使用Internet Explorer的步骤
我已经下载了64位的IE驱动服务器,并将其解压缩并保存在我的桌面上 同时,我在Internet Explorer中做了以下修改: 1) 将浏览器缩放级别更改为100% 2) 选中所有区域的“启用保护模式”复选框 3) 保持所有区域级别为“中高” 现在,我正在eclipse中编写以下代码:Selenium webdriver 如何安装IEDriverServer_x64_389;。。在webdriver中使用Internet Explorer的步骤,selenium-webdriver,Selenium Webdriver,我已经下载了64位的IE驱动服务器,并将其解压缩并保存在我的桌面上 同时,我在Internet Explorer中做了以下修改: 1) 将浏览器缩放级别更改为100% 2) 选中所有区域的“启用保护模式”复选框 3) 保持所有区域级别为“中高” 现在,我正在eclipse中编写以下代码: public static void main(String args[]) { File file=new File("C:\\Users\\RASH\\Desktop\\Selenium\\Sele
public static void main(String args[])
{
File file=new File("C:\\Users\\RASH\\Desktop\\Selenium\\Selenium jars\\IEDriverServer.exe");
System.setProperty("Webdriver.ie.driver",file.getAbsolutePath());
WebDriver driver= new Internet Explorer Driver();
driver.get("http://google.com");
}
但在运行时,我遇到了一个异常:
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list
可执行文件的位置必须在您的路径中 要将文件夹添加到路径中,请导航到
控制面板>系统>高级系统设置>环境变量
,在底部窗口中找到名为路径
的变量,选择它并单击编辑
然后添加一个分号,后跟要添加到路径的目录。例如,追加
;C:\Drivers\
到现有路径,其中IEDriver位于C:\Drivers\
目录中。谢谢您的建议。但是在完成路径设置后,它运行良好。但是在eclipse的控制台中,我在线程“main”中得到了java.long.illegalStateException异常。