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