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

后端 未结 5 1205
天命终不由人
天命终不由人 2020-11-28 05:09

I am using Selenium for automating the tests. My application exclusively uses IE, it will not work on other Browsers.

Code:

import org.openqa.seleniu         


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 06:00

    1. You will need InternetExplorer driver executable on your system. So download it from the hinted source (http://www.seleniumhq.org/download/) unpack it and place somewhere you can find it. In my example, I will assume you will place it to C:\Selenium\iexploredriver.exe

    2. 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

提交回复
热议问题