How do I setup the InternetExplorerDriver so it wo

2019-03-11 02:45发布

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?

I am getting the following error:

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

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

7条回答
爷、活的狠高调
2楼-- · 2019-03-11 03:11

Here is the exact solution, which worked in my case:

  1. On IE 7 or higher on Windows Vista or Windows 7, you must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode". Additionally, "Enhanced Protected Mode" must be disabled for IE 10 and higher. This option is found in the Advanced tab of the Internet Options dialog.

  2. System.setProperty("webdriver.ie.driver","C:\\Users\\ssin22\\Downloads\\IEDriverServer_x64_2.48.0\\IEDriverServer.exe");


package Testing;

import java.io.File;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class LaunchIE {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        System.setProperty("webdriver.ie.driver","C:\\Users\\ssin22\\Downloads\\IEDriverServer_x64_2.48.0\\IEDriverServer.exe");

    WebDriver driver=new InternetExplorerDriver();
    driver.get("http://google.com");

    }

}
查看更多
登录 后发表回答