参考代码实现:
public class IEBrowserLaunchDemo {
public static void main(String[] args) {
//Creating a driver object referencing WebDriver interface
WebDriver driver;
//Setting the webdriver.ie.driver property to its executable's location
System.setProperty("webdriver.ie.driver", "/lib/IEDriverServer/IEDriverServer.exe");
//Instantiating driver object
driver = newInternetExplorerDriver();
//Using get() method to open a webpage
driver.get("http://yiibai.com");
//Closing the browser
driver.quit();
}
}