打开谷歌浏览器

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.WebDriver;

 

public classStartChromeExplorer {

 

    public static void main(String[] args) {

        System.setProperty("webdriver.chrome.driver", "C:\\Program Files(x86)\\Google\\Chrome\\Application\\chromedriver.exe");

        WebDriverdriver= newChromeDriver();

        Stringurl= "http://www.163.com";

        driver.get(url);

        driver.quit();

 

    }

 

}

你可能感兴趣的:(打开谷歌浏览器)