<<  < 2021 - >  >>
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30




maven 依赖
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
代码
public class testSecurity {
public static void main(String[] args) throws CutsmerException, InterruptedException {

System.setProperty("webdriver.chrome.driver","C:\\Users\\Longing\\Desktop\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://mail.163.com/");
WebDriver = driver.switchTo().(0);
WebElement input=.findElement(By.className("dlemail"));
WebElement passWord=.findElement(By.className("dlpwd"));
input.sendKeys("chenli1892021");
passWord.sendKeys("chenli12");
driver.findElement(By.className("u-loginbtn")).click();


}
}
发表评论:
天涯博客欢迎您!