package com.newdream.day1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class demo1 {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
//实战
//1.实例化一个驱动 ,也就是请一个司机,同时启动浏览器
WebDriver driver=new ChromeDriver();
//2.使用驱动打开百度网站
driver.get("https://www.baidu.com/");
//3.窗口最大化
driver.manage().window().maximize();
//4.在百度搜索框输入“新梦想测试”
driver.findElement(By.name("wd")).sendKeys("鞋");
//5.点击“百度一下”
driver.findElement(By.id("su")).click();
//6.睡眠5s
Thread.sleep(5000);
//7.关闭浏览器
driver.quit();
}
}