package com.hogwarts.webui; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.WebElement; public class TestUI { public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "D:\\IdeaProject\\iSelenium\\src\\test\\webdriver\\chromedriver.exe");// chromedriver服务地址 WebDriver webDriver = new ChromeDriver(); String url = "http://www.baidu.com"; webDriver.get(url); // 打开指定的网站 Thread.sleep(3000); webDriver.quit(); } }