You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
638 B

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();
}
}