package com.ChaptDemo01; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.List; /** * Created by Administrator on 2018/5/25 0025. */ //定位一个 元素 一般使用 ID name xpath 其余的视情况而定 public class FindElements { //打开百度 定位 搜索文本框 WebDriver driver; @BeforeMethod public void openBrower(){ //配置Chrome 驱动 System.setProperty("webdriver.chrome.driver","E:\\browser\\chromedriver.