如何设置InternetExplorerDriver使其工作 [英] How do I setup the InternetExplorerDriver so it works

查看:1081
本文介绍了如何设置InternetExplorerDriver使其工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WebDriver,并且已经下载了InternetExplorerDriver,并且想知道下载后该怎么办?

I am using WebDriver and I have downloaded the InternetExplorerDriver and was wondering what I do with it after it is downloaded?

这个表示把司机放在我的路上。真的不知道他们在说什么。

This says to put the driver in my path. Not really certain what exactly they are talking about there.

有没有人使用过这个,如果可以的话,您可以提供详细的步骤,以便如何设置,以便它可以工作?

Has anyone used this and if so could you provide detailed steps on how to set it up so it will work?

我收到以下错误:


驱动程序可执行文件的路径必须由
webdriver.ie .driver系统属性

The path to the driver executable must be set by the webdriver.ie.driver system property

我下载了IE和Chrome驱动程序的可执行文件。我在哪里设置?

I downloaded the executables for IE and the Chrome driver. Where do I set it at?

推荐答案

打开包装并放置在可以找到的地方。在我的例子中,我会假设你将它放到C:\Selenium\iexploredriver.exe

Unpack it and place somewhere you can find it. In my example, I will assume you will place it to C:\Selenium\iexploredriver.exe

然后你必须在系统中设置它。这是从我的Selenium项目粘贴的Java代码:

Then you have to set it up in the system. Here is the Java code pasted from my Selenium project:

File file = new File("C:/Selenium/iexploredriver.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
WebDriver driver = new InternetExplorerDriver();

基本上,您必须在初始化驱动程序之前设置此属性。

Basically, you have to set this property before you initialize driver

参考:

  • Driver executable must be set by the webdriver.ie.driver system property

这篇关于如何设置InternetExplorerDriver使其工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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